I use Yii php to receive data from android and ios app.
I tried postman as below picture: http://i.stack.imgur.com/KaqX0.jpg
But in php, I always receipt "file_get_contents('php://input')":
------WebKitFormBoundaryHDGkntVW3uMr7FlA
Content-Disposition: form-data; name="email"
[email protected]
------WebKitFormBoundaryHDGkntVW3uMr7FlA
Content-Disposition: form-data; name="user"
test223user
------WebKitFormBoundaryHDGkntVW3uMr7FlA
Content-Disposition: form-data; name="password"
123456
------WebKitFormBoundaryHDGkntVW3uMr7FlA
Content-Disposition: form-data; name="firstname"
Le
------WebKitFormBoundaryHDGkntVW3uMr7FlA
Content-Disposition: form-data; name="lastname"
Phuong
------WebKitFormBoundaryHDGkntVW3uMr7FlA--
How to receive right json encode :( It's take me 3 days, still not resolved
If you use Yii2 try to use yii\rest\ActiveController for API controllers and don't forget enable json input. More info in yii2 docs - yii2 rest quick start
p.s. also, you can use "file_get_contents('php://input')" in actions, but i think it is not yii-way.
이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.
침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제
몇 마디 만하겠습니다