PHP默認只識別application/x-www.form-urlencoded標準的數據類型,所以,對型如text/xml 或者 soap 或者 application/octet-stream 之類的內容沒法解析,若是用$_POST數組來接收就會失敗!故保留原型,交給$GLOBALS['HTTP_RAW_POST_DATA'] 來接收html
---------------------------------------------------json
參考:數組
Request Headers:app
User-Agent: Fiddler
Host: localhost:3248
Content-Type: application/json; charset=utf-8
Content-Length: 63url
要加上Content-Type: application/json; charset=utf-8,要不是JSON沒效spa
Request Bodycode
{"UserID":4,"UserName":"Parry","UserEmail":"Parry@cnblogs.com"}orm
緊記,不要寫成這樣:[{"UserID":4,"UserName":"Parry","UserEmail":"Parry@cnblogs.com"}]xml