We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 here.

Webservice Rest client

Hi,

I have an URL HTTP with get parameter (ex : https://mydomain.com/params?param=X) who returns a JSON object. It is possible with Phalcon to get the return of this url ?

This way:

$data = file_get_contents("https://mydomain.com/params?param=X");
edited Nov '15

With file_get_contents you cannot put custom header fields (auth/security) etc.

Is there a more convinient framework-like way to achieve ineraction with external web services (i.e. consumer component)?

Or just to stick with raw PHP (cURL) and write one class to handle it all.