Posting JSON object through WinJS.XHR
问题 I'm having abit of problems posting data from WinJS.xhr to a PHP script. "obj" is a stringified JSON object WinJS.xhr({ type: "POST", url: dataUrl, headers: { "Content-type": "application/x-www-form-urlencoded" }, data: obj, }) However the $_POST variable is always empty. I've tried changing content-types, and escaping the object but no luck :( 回答1: Your content-type when posting json should typically be application/json Secondly make sure you 'stringify' your json object. Based on: Post JSON