3

I am making a RESTful API in Yii 1.1.10. In POST request I can get parameters from request body using

$GLOBALS['HTTP_RAW_POST_DATA'];

Although it might not be the ideal solution in Yii. But I am not able to get body parameters in GET REST request. I understand that for GET in REST, parameters should be sent in the URL but I want to get encoded data from body.

Shahid
  • 660
  • 8
  • 16

1 Answers1

5

In Yii there is a very usefull class ChttpRequest, you should checkout CHttpRequest->getRawBody()

Edit: to actually use it in the app use : Yii::app()->request->getRawBody()

DarkMukke
  • 2,354
  • 1
  • 22
  • 30