Answers.Body: <p>Yes, you can use <a href="http://www.yiiframework.com/doc/api/1.1/CHttpRequest#getRestParams-detail" rel="nofollow noreferrer">getRestParams()</a> like so: <code>$input = craft()-&gt;request-&gt;getRestParams()</code></p>
  
  <p>A bit confusing naming there, which is why it's changing to <code>getBodyParams()</code> in Yii 2.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-01-25T09:08:06.763Z
Answers.LastActivityDate: 2017-01-25T09:08:06.763Z
Answers.UserDisplayName: Fred Carlsen
Body: <p>Is there a way with the request service to read POSTed JSON from <code>php://input</code>?</p>
  
Tags: <request><https>
Title: Read POSTed JSON data from the request body
ThreadText: # Read POSTed JSON data from the request body
  
  (Asked by: username_0 on 2017-01-25)
  
  Is there a way with the request service to read POSTed JSON from `php://input`?
  
  **Tags:** request, https
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_0 on 2017-01-25. Score: 3 | Accepted answer
  
  Yes, you can use [getRestParams()](http://www.yiiframework.com/doc/api/1.1/CHttpRequest#getRestParams-detail) like so: `$input = craft()->request->getRestParams()`
  
  A bit confusing naming there, which is why it's changing to `getBodyParams()` in Yii 2.
  
  
  ---
  
  