thorben.t
thorben.t

Reputation: 41

Sending REST Requests with Symfony2

Is there any bundle that can send REST requests to external web pages? I need PUT and DELETE as well as PATCH (http method).

Upvotes: 3

Views: 3055

Answers (1)

Tobias
Tobias

Reputation: 954

You are looking for this bundle: https://github.com/CircleOfNice/CiRestClientBundle

$restClient = $this->container->get('ci.restclient');

$restClient->get('http://www.someUrl.com');
$restClient->post('http://www.someUrl.com', 'somePayload');
$restClient->put('http://www.someUrl.com', 'somePayload');
$restClient->delete('http://www.someUrl.com');
$restClient->patch('http://www.someUrl.com', 'somePayload');

$restClient->head('http://www.someUrl.com');
$restClient->options('http://www.someUrl.com', 'somePayload');
$restClient->trace('http://www.someUrl.com');
$restClient->connect('http://www.someUrl.com');

Upvotes: 4

Related Questions