Skip to content

Latest commit

 

History

History
29 lines (25 loc) · 639 Bytes

README.textile

File metadata and controls

29 lines (25 loc) · 639 Bytes

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)