Get support for php-http/laravel-httplug

If you're new to LTH, please see our FAQ for more information on what it is we do.

Support Options

Unfortunately, there are currently no active helpers for this repository on the platform. Until they become available, we reccomend the following actions:

View Open Issues

Take a look to see if anyone else has experienced the same issue as you and if they managed to solve it.

Open an Issue

Make sure to read any relevant guidelines for opening issues on this repo before posting a new issue.

Sponsor directly

Check out the page and see if there are any options to sponsor this project or it's developers directly.

php-http/laravel-httplug

Laravel-Httplug

Latest Version Software License Build Status Code Coverage Quality Score Total Downloads

Install

Via Composer

$ composer require php-http/laravel-httplug

With Laravel 5.5 or newer, the package will be discovered automatically. If you're using an older version of Laravel, add the following to your config/app.php:

<?php
// config.app

'providers' => [
    ...,
    ...,

     Http\Httplug\HttplugServiceProvider::class,

],

'aliases' => [
    ...,
    ...,

    'Httplug'   => Http\Httplug\Facade\Httplug::class,

],


Publish the package config file to config/httplug.php:

php artisan vendor:publish --provider="Http\Httplug\HttplugServiceProvider"

Usage

<?php

// Create a request using a MessageFactory
$factory = app()->make('httplug.message_factory.default');
$request = $factory->createRequest('GET', 'http://httpbin.org');

$httplug = app()->make('httplug');

// Send request with default driver
$response = $httplug->sendRequest($request);

// Send request with another driver
$response = $httplug->driver('curl')->sendRequest($request);

// Send request with default driver using facade
$response = Httplug::sendRequest($request);

// Send request with another driver using facade
$response = Httplug::driver('curl')->sendRequest($request)

Testing

$ composer test

Contributing

Please see our contributing guide.

Security

If you discover any security related issues, please contact us at security@php-http.org.

License

The MIT License (MIT). Please see License File for more information.

Our Mission

We want to make open source more sustainable. The entire platform was born from this and everything we do is in aid of this.

Interesting Articles

Thank you for checking out LiveTechHelper |
2025 © lth-dev incorporated

p-e622a1a2