PHP에서 json post 를 처리하는 방법.
OLD POSTS 2012. 4. 26. 16:03
How to Handle JSon POST Request Using PHP
http://edwin.baculsoft.com/2011/12/how-to-handle-json-post-request-using-php/
On my last project, i need to create a php service using JSon to handle service requests from multiple clients. My PHP file would consume JSon string for its requests and produce JSon string as its responses.
Im not too familiar with PHP, but after sometime googling i’ve found a workaround. This is how i do it.
This is the http header and body of request and response.
Hope it help others, have fun with JSon
지난글에서 C# 으로 post json 데이터를 날리는 경우에는
Content-Type 가
application/x-www-form-urlencoded
인 경우에는 $_POST[postData] 로 받아서 처리하면 되는데.
Content-Type 자체가
application/json
인 경우에는 php 에서 위와 같이 처리한다.
'OLD POSTS' 카테고리의 다른 글
2012년 11월 UDK 릴리즈 노트 중에서. (0) | 2012.11.28 |
---|---|
Setting Up Configuration Files for a New Game Project (0) | 2012.11.27 |
[C#] HttpWebRequest 클래스를 이용한 POST 전송하기. (0) | 2012.04.26 |
Fonts for ipad, iphone (0) | 2011.02.04 |
WPF의 datagrid 의 스타일 정의. (0) | 2011.01.07 |