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
It looks like when an OpenAPI spec specifies multipart/form-data in the request body, swagger-js will encode the POST body as JSON, as indicated by this sample request.
Is there any configuration that controls the encoding of the POST body? Or are there any docs that specify which content-type maps to which encoding? I'm working against a server that only accepts formData key/value pairs e.g. email=foo@bar.com&password=123.
curl examples for reference
Both of these content types demonstrate non-JSON-encoded bodies by default.
Q&A (please complete the following information)
Swagger/OpenAPI definition:
Partial spec relevant to the question:
Swagger-Client usage:
How can we help?
It looks like when an OpenAPI spec specifies
multipart/form-data
in the request body, swagger-js will encode thePOST
body asJSON
, as indicated by this sample request.Client code:
Resulting request (as logged by req interceptor):
I verified the exact request using
ngrep
as well:Is there any configuration that controls the encoding of the POST body? Or are there any docs that specify which content-type maps to which encoding? I'm working against a server that only accepts formData key/value pairs e.g.
email=foo@bar.com&password=123
.curl
examples for referenceBoth of these content types demonstrate non-JSON-encoded bodies by default.
multipart/form-data
Resulting req:
Notice how this uses KV pairs
&
delimiter.application/x-www-form-urlencoded
The text was updated successfully, but these errors were encountered: