A minimalist HTTP client for PHP
PHP
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
README.textile
http.php

README.textile

A minimalist HTTP client for PHP.

GET

  
$options = array (
  'debug_log' => '/tmp/http.log',
  'follow_redirects' => false,
  'connect_timeout' => 30000,
  'cookie_jar' => '/app/tmp/cookies.txt',
  'proxy' => 'http-proxy:8080'
)
$headers = array('User-Agent' => 'Googlebot/2.1 ( http://www.googlebot.com/bot.html)');
$response = HTTP::get('http://google.com', $headers, $options);
  

POST

  
$parameters = array(
  'name' => 'Data',
  'file' => "@$file"#(file_get_contents('/tmp/data.txt')) # File upload
);
$response = HTTP::post('http://my-files/upload', $parameters)
  

License

Released under the MIT license:
www.opensource.org/licenses/MIT