You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Dec 19, 2024. It is now read-only.
POST requests using iron-form and sending JSON as request body, is misinterpreted by requesting URL. My test shows a simple nodejs server that accepts POST requests and prints out body using body-parser API. I'm using Polymer 1.0 with iron-form inside a custom component.
This is still an issue in 1.0.4 and I believe also in the master branch— I think the relevant block of code is below, the logic doesn't make a lot of sense to me:
What I'm reading is that the content type is indeed sent correctly but that the form will send a serialized JSON body (JSON.stringify(json)) regardless of the content-type that was set by the developer of the page. In my case, the server endpoint that I am targeting does not accept JSON data — I'm relying on the encoding which is specified as the default in the documentation of this element, i.e. application/x-www-form-urlencoded.
POST requests using iron-form and sending JSON as request body, is misinterpreted by requesting URL. My test shows a simple nodejs server that accepts POST requests and prints out body using body-parser API. I'm using Polymer 1.0 with iron-form inside a custom component.
The request body json data:

The text was updated successfully, but these errors were encountered: