-
Notifications
You must be signed in to change notification settings - Fork 1
Rest Component Basic Usage
Rolies Debby edited this page Aug 2, 2013
·
2 revisions
Rest component inside this application is wrapper for Requests by rmccue, I just made it more simply to use.
list($body, $info) = Yii::app()->rest->get('/endpoint/path', $args = array(), $header = array());
This will return $body
that contain result and $info
for HTTP info included header response.
list($body, $info) = Yii::app()->rest->post('/endpoint/path', $args = array(), $header = array(), $extra = array());
For now $extra
arguments only accept array('multipart' => true/false)
for telling Rest component to send the request with multipart data.
list($body, $info) = Yii::app()->rest->put('/endpoint/path', $args = array(), $header = array(), $extra = array());
list($body, $info) = Yii::app()->rest->delete('/endpoint/path', $args = array(), $header = array());