https://github.com/bigcommerce/net-http
A basic HTTP client.
https://github.com/bigcommerce/net-http
Last synced: 3 months ago
JSON representation
A basic HTTP client.
- Host: GitHub
- URL: https://github.com/bigcommerce/net-http
- Owner: bigcommerce
- License: mit
- Created: 2012-12-04T01:05:42.000Z (over 13 years ago)
- Default Branch: master
- Last Pushed: 2024-12-29T20:42:43.000Z (over 1 year ago)
- Last Synced: 2025-04-10T05:08:09.298Z (about 1 year ago)
- Language: PHP
- Size: 36.1 KB
- Stars: 9
- Watchers: 33
- Forks: 8
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
HTTP Client
===========
Provides a basic HTTP client that wraps the PHP curl extension.
Making a GET request:
```php
$client = new Net_Http_Client();
$client->get("http://bigcommerce.com/");
$body = $client->getBody();
$contentType = $client->getHeader("Content-Type");
```
Making a POST request:
```php
$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
}
```