# php-http-agent **Repository Path**: marjune/php-http-agent ## Basic Information - **Project Name**: php-http-agent - **Description**: A set of wrapper classes to make http request easier using php curl - **Primary Language**: PHP - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2015-02-07 - **Last Updated**: 2020-12-19 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # Quick Start ## Get Content ```php $http = new HttpGetAgent('http://www.example.com?a=1'); $http->addGetParameter('b', 2); $http->addGetParameter('c', 3); $result = $http->request(); //this will get content from http://www.example.com?a=1&b=2&c=3 ``` ## Post Content like a form ```php $http = new HttpPostFormAgent('http://www.example.com/contact'); $http->setRequestHeader('Referer', 'http://www.example.com'); $http->addPostParameter('name', 'foo'); $http->addPostParameter('tel', 'bar'); $http->addPostParameter('email', 'dummy@example.com'); $http->addPostParameter('message', 'Lorem ipsum dolor sit amet, ...'); $result = $http->request(); ``` ## Post JSON content ```php $http = new HttpPostJsonAgent('http://www.example.com/submit_json); $http->postData=array('a'=>1, 'b'=>2); $result = $http->request(); ```