I want/need Phalcon to be able to get remote data from a webservice and bring it back to the Phalcon server for display. It also needs to supply header parameters as well as path and query parameters.
So the scenario would be like this:
- Operator would access http://myPhalconSite.com/users/24
- Phalcon code would then go to http://184.108.40.206 with path params of 'users' and '24' plus header params of 'token' => 'myToken' and 'Accept' => 'application/json' and get a json string in return
- Phalcon would parse that string and pass it off to the correct view
- The correct view would display the data of user #24 to the Operator
Forgive the formatting but the markup seems way off.
Can Phalcon do this? What Model class do I use? Is there any example showing something like this? I have googled but no joy. Also I am presuming that Phalcon can indeed unmarshal the json string straight to a given class, or is this an incorrect assumption?