net / http
A basic HTTP client
Installs: 800 455
Dependents: 7
Suggesters: 0
Security: 0
Stars: 9
Watchers: 36
Forks: 8
Open Issues: 1
Requires (Dev)
- phpstan/phpstan: ^1.10
- phpunit/phpunit: ^10.0
This package is not auto-updated.
Last update: 2025-01-18 16:44:42 UTC
README
Provides a basic HTTP client that wraps the PHP curl extension.
Making a GET request:
$client = new Net_Http_Client(); $client->get("http://bigcommerce.com/"); $body = $client->getBody(); $contentType = $client->getHeader("Content-Type");
Making a POST request:
$client = new Net_Http_Client(); $client->post("http://bigcommerce.com/contact.php", array("key"=>"value")); $responseCode = $client->getStatus(); if ($responseCode != 200) { // the request returned an error response }