huss
(huss@tahn.biz)
April 18, 2014, 11:59am
1
Can anyone demonstrate how a POST method would be used to send information to a RESTful Web Service API?
I already have the service working, for example:
http://api.myapp/endpoint
In my application I have a form, once submitted how do I send
Yii::$app->request->post()
to the service?
samdark
(Alexander Makarov)
April 18, 2014, 7:05pm
2
huss
(huss@tahn.biz)
April 19, 2014, 6:37am
3
I actually want to implement this in the controller and possibly manipulate the post data before sending to the web service.
samdark
(Alexander Makarov)
April 19, 2014, 9:03am
4
Yii has REST API framework that is to create APIs, not use other APIs. As for calling other APIs, check CURL or something more sophisticated such as https://github.com/guzzle/guzzle
huss
(huss@tahn.biz)
April 19, 2014, 9:42am
5
I can do this with curl, I just thought there might have been somthing in the framework I missed. Thanks