2017 © Pedro Peláez
 

library curl-agent

Curl Agent Classes

image

corneltek/curl-agent

Curl Agent Classes

  • Saturday, June 14, 2014
  • by c9s
  • Repository
  • 1 Watchers
  • 3 Stars
  • 9 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 1 Open issues
  • 9 Versions
  • 0 % Grown

The README.md

CurlAgent

Simple Curl interface that allows you to operate HTTP requests / responses easily., (*1)

$agent = new CurlAgent\CurlAgent;
$agent->setProxy('host:port');
$agent->setConnectionTimeout(30); // 30 seconds timeout

try {

    // simply send POST and GET request
    $response = $agent->post('http://does.not.exist');
    $response = $agent->get('http://does.not.exist');

    // send GET and POST with parameters and headers
    $response = $agent->get('http://does.not.exist', [ 'param1' => 'value' ], [ 'accept: text/xml', 'content-type: text/xml;' ]);
    $response = $agent->post('http://does.not.exist', [ 'name' => 'value' ], [ 'accept: text/xml' , ... ]);


    $response = $agent->get('http://does.not.exist', [ 'param1' => 'value' ], [ 'accept: text/xml', 'content-type: text/xml;' ]);
    $response = $agent->post('http://does.not.exist', [ 'name' => 'value' ], [ 'accept: text/xml' , ... ]);


    $response; // CurlResponse object

    $response->body; // raw response body


    $headers = $response->headers;
    foreach ($headers as $field => $value) {
        //....
    }

    // decode body based on the content-type of the response. currently we only support application/json and text/json
    $ret = $response->decodeBody();

} catch ( CurlException $e ) {
    // handle exception here
}

CurlRequest

$req = new CurlRequest('http://path/to/page.html', 'GET', [ parameters ... ], [ 'Content-Type' => '...' ]);
$response = $agent->sendRequest($req);

The Versions

14/06 2014

dev-master

9999999-dev

Curl Agent Classes

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

The Development Requires

14/06 2014

1.2.0

1.2.0.0

Curl Agent Classes

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

The Development Requires

14/06 2014

1.1.5

1.1.5.0

Curl Agent Classes

  Sources   Download

The Requires

  • php >=5.3.0

 

The Development Requires

11/06 2014

1.1.4

1.1.4.0

Curl Agent Classes

  Sources   Download

The Requires

  • php >=5.3.0

 

The Development Requires

11/06 2014

1.1.3

1.1.3.0

Curl Agent Classes

  Sources   Download

The Requires

  • php >=5.3.0

 

The Development Requires

11/06 2014

1.1.2

1.1.2.0

Curl Agent Classes

  Sources   Download

The Requires

  • php >=5.3.0

 

The Development Requires

09/06 2014

1.1.1

1.1.1.0

Curl Agent Classes

  Sources   Download

The Requires

  • php >=5.3.0

 

The Development Requires

09/06 2014

1.1.0

1.1.0.0

Curl Agent Classes

  Sources   Download

The Requires

  • php >=5.3.0

 

The Development Requires

09/06 2014

1.0.0

1.0.0.0

Curl Agent Classes

  Sources   Download

The Requires

  • php >=5.3.0

 

The Development Requires