JSONを本文にPOSTリクエストを投げることが増えてきた HTTP/1.1 Content-Type:application/json ###<-- jsonになっているで直接JSONを本文に投げてくるクライアントが増えてきていることを知りましました。 HTTPのPOSTと言えば、form urlencodedですが、JSONを本文に入れることがあります。 HTTPヘッダサンプル(JSON版) HTTP/1.1 User-Agent: Opera/9.80 (Macintosh; Intel Mac OS X 10.8.4) Presto Host: example.com Accept-Encoding: gzip, deflate Cache-Control: no-cache Connection: Keep-Alive Content-Type:application/json
![PHPでHTTP POSTされたJSON本文のbodyを受け取る方法 - それマグで!](https://cdn-ak-scissors.b.st-hatena.com/image/square/e76ae70f4ffed157feb14f399fa25c658eb42b35/height=288;version=1;width=512/https%3A%2F%2Fcdn-ak.f.st-hatena.com%2Fimages%2Ffotolife%2Ft%2Ftakuya_1st%2F20170308%2F20170308020523.png)