xui/xui — Issue #66: Cannot customize Content-Type header on xhr() POST
Author: arkusuma
Created: 2011-12-29 09:21:42+00:00
State: open

My web service was strictly accepting request with Content-Type: application/json
I cannot get that kind of header in XUI. The code below always produce
Content-Type: application/x-www-form-urlencoded, application/json

Code:

x$("#result").xhr("/mobile.asmx/arsip", {
method: "post",
async: true,
data: '{"hal": 1}',
headers: { "Content-Type": "application/json" },
});