blar/curl

This package is abandoned and no longer maintained. No replacement package was suggested.

Curl for PHP

dev-master 2017-01-07 09:03 UTC

This package is auto-updated.

Last update: 2018-09-29 14:21:11 UTC


README

License Latest Stable Version Build Status Coverage Status Dependency Status Flattr

OOP-Wrapper für Curl

Anfrage erstellen

$curl = new Curl();
$curl->setUrl('http://www.example.com/');
$response = $curl->execute();

POST versenden

$curl = new Curl();
$curl->setMethod('POST');
$curl->setUrl('http://www.example.com/');
$curl->setBody(array(
    'foo' => 23,
    'bar' => 42
));
$response = $curl->execute();

Verbindung über Proxy erstellen

$curl = new Curl();
$curl->setUrl('http://www.example.com/');

$socket = new NetworkSocket('proxy.example.com', 3128);
$proxy = new CurlProxy($socket);
$curl->setProxy($proxy);

$response = $curl->execute();

Verbindung über Proxy mit Zugangsdaten erstellen

$curl = new Curl();
$curl->setUrl('http://www.example.com/');

$proxy = new CurlProxy();

// Adresse und Port des Proxyservers
$socket = new NetworkSocket('proxy.example.com', 3128);
$proxy->setSocket($socket);

// Zugangsdaten für den Proxyserver
$credentials = new BasicCredentials('userName', 'password');
$proxy->setCredentials($credentials);

$curl->setProxy($proxy);

$response = $curl->execute();

Installation

Abhängigkeiten

Abhängigkeiten von blar/curl auf gemnasium anzeigen

Installation per Composer

$ composer require blar/curl

Installation per Git

$ git clone https://github.com/blar/curl.git