2017 © Pedro Peláez
 

library curl-http-client

Curl based HTTP Client - Simple but effective OOP wrapper around Curl php lib. It allows sending post/get requests, using proxy, binding to specific IP, storing cookies etc.

image

dinke/curl-http-client

Curl based HTTP Client - Simple but effective OOP wrapper around Curl php lib. It allows sending post/get requests, using proxy, binding to specific IP, storing cookies etc.

  • Tuesday, November 3, 2015
  • by dinke
  • Repository
  • 3 Watchers
  • 17 Stars
  • 319 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 13 Forks
  • 0 Open issues
  • 8 Versions
  • 3 % Grown

The README.md

CurlHttpClient

Curl based HTTP Client - Simple but effective OOP wrapper around Curl php lib. It allows sending post/get requests, using proxy, binding to specific IP, storing cookies etc., (*1)

Installation

Add CurlHttpClient to your composer.json, (*2)

{
    "require": {
        "dinke/curl-http-client": "dev-master"
    }
}

Usage


$curl = new \Dinke\CurlHttpClient; //pretend to be Firefox 19.0 on Mac $useragent = "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:19.0) Gecko/20100101 Firefox/19.0"; $curl->setUserAgent($useragent); //uncomment next two lines if you want to automatically manage cookies //which will store them to file and send them on each http request //$cookies_file = "/tmp/cookies.txt"; //$curl->storeCookies($cookies_file); //Uncomment next line if you want to set credentials for basic http_auth //$curl->setCredentials($username, $password); //Uncomment next line if you want to set specific referrer //$curl->setReferer('http://www.foo.com/referer_url/'); //if you want to send some post data //form post data array like this one $post_data = ['login' => 'pera', 'password' => 'joe', 'other_foo_field' => 'foo_value']; //or like a string: $post_data = 'login=pera&password=joe&other_foo_field=foo_value'; //and send request to http://www.foo.com/login.php. Result page is stored in $html_data string $html_data = $curl->sendPostData("http://www.foo.com/login.php", $post_data); //You can also fetch data from somewhere using get method! //Fetch html from url $html_data = $curl->fetchUrl("http://www.foo.com/foobar.php?login=pera&password=joe&other_foo_field=foo_value"); //if you have more than one IP on your server, //you can also bind to specific IP address like ... //$bind_ip = "192.168.0.1"; //$curl->fetch_url("http://www.foo.com/login.php", $bind_ip); //$html_data = $curl->sendPostData("http://www.foo.com/login.php", $post_data, $bind_ip); //and there are many other things you can do like //use proxy //$curl->setProxy('http://www.proxyurl.com'); //use proxy auth //$curl->setProxyAuth('user:pass'); //get http response code for last request //$http_code = $curl->getHttpResponseCode(); //get last http request duration in sec //$duration = $curl->get_requestDuration();

The Versions

03/11 2015

dev-develop

dev-develop https://github.com/dinke/curl_http_client

Curl based HTTP Client - Simple but effective OOP wrapper around Curl php lib. It allows sending post/get requests, using proxy, binding to specific IP, storing cookies etc.

  Sources   Download

LGPLv3

The Requires

  • php >=5.3.0
  • ext-curl *

 

curl

20/06 2015

dev-master

9999999-dev https://github.com/dinke/curl_http_client

Curl based HTTP Client - Simple but effective OOP wrapper around Curl php lib. It allows sending post/get requests, using proxy, binding to specific IP, storing cookies etc.

  Sources   Download

LGPLv3

The Requires

  • php >=5.3.0
  • ext-curl *

 

curl

20/06 2015

v2.0.8

2.0.8.0 https://github.com/dinke/curl_http_client

Curl based HTTP Client - Simple but effective OOP wrapper around Curl php lib. It allows sending post/get requests, using proxy, binding to specific IP, storing cookies etc.

  Sources   Download

LGPLv3

The Requires

  • php >=5.3.0
  • ext-curl *

 

curl

08/05 2015

v2.0.7

2.0.7.0 https://github.com/dinke/curl_http_client

Curl based HTTP Client - Simple but effective OOP wrapper around Curl php lib. It allows sending post/get requests, using proxy, binding to specific IP, storing cookies etc.

  Sources   Download

LGPLv3

The Requires

  • php >=5.3.0
  • ext-curl *

 

curl

10/02 2015

v2.0.6

2.0.6.0 https://github.com/dinke/curl_http_client

Curl based HTTP Client - Simple but effective OOP wrapper around Curl php lib. It allows sending post/get requests, using proxy, binding to specific IP, storing cookies etc.

  Sources   Download

LGPLv3

The Requires

  • php >=5.3.0
  • ext-curl *

 

curl

29/12 2014

v2.0.5

2.0.5.0 https://github.com/dinke/curl_http_client

Curl based HTTP Client - Simple but effective OOP wrapper around Curl php lib. It allows sending post/get requests, using proxy, binding to specific IP, storing cookies etc.

  Sources   Download

LGPLv3

The Requires

  • php >=5.3.0
  • ext-curl *

 

curl

12/10 2014

v2.0.4

2.0.4.0 https://github.com/dinke/curl_http_client

Curl based HTTP Client - Simple but effective OOP wrapper around Curl php lib. It allows sending post/get requests, using proxy, binding to specific IP, storing cookies etc.

  Sources   Download

LGPLv3

The Requires

  • php >=5.3.0
  • ext-curl *

 

curl

12/10 2014

v2.0.3

2.0.3.0 https://github.com/dinke/curl_http_client

Curl based HTTP Client - Simple but effective OOP wrapper around Curl php lib. It allows sending post/get requests, using proxy, binding to specific IP, storing cookies etc.

  Sources   Download

LGPLv3

The Requires

  • php >=5.3.0

 

curl