0

I think there is a quite easy answer but, I tried to send a POST request to a REST api from a controller like that :

use Symfony\Component\HttpFoundation\Request;

...

$request = Request::create('127.0.0.1', 'POST', array('test' => 'this is a test'));

but It did nothing, is there anything missing like send or execute method ? Thanks a lot

1 Answer 1

0

By doing so, you're only creating Request object. No actual request will be sent out.

To do that I suggest you use: Buzz

Ultimately, you may use SensioBuzzBundle in order to have Buzz as service

EDIT:

Forgot to mention: I believe that buzz actually uses curl

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.