Skip to content

switon-php/http-client

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Switon HTTP Client Package

HTTP client integrations for Switon Framework.

Installation

composer require switon/http-client

Requirements: PHP 8.3+, ext-curl

Quick Start

use Switon\Core\Attribute\Autowired;
use Switon\HttpClient\HttpClientInterface;

class ApiService
{
    #[Autowired] protected HttpClientInterface $httpClient;

    public function createUser(array $data): array
    {
        $response = $this->httpClient->post('https://api.example.com/users', $data);

        return $response->json();
    }
}

Docs: https://docs.switon.dev/latest/http-client

License

MIT.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages