This repository was archived by the owner on Apr 12, 2024. It is now read-only.
This repository was archived by the owner on Apr 12, 2024. It is now read-only.
$xhr posts JSON data as form-urlencoded #395
Closed
Description
When posting an object via $xhr
$xhr('/some/uri', 'POST', {some:'object'});
The default behavior is to encode that object as JSON. This would be fine if the default Content-Type of $browser.xhr
was application/json, but it's application/x-www-form-urlencoded.
Since you can't set the Content-Type via $xhr (see #180), then this feature is virtually unusable, confusing and probably an inappropriate default.
Solution is to urlencode the object instead of JSON