-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Multipart POST failing #1202
Comments
Never set Content-Type with multipart, as it erases the boundary argument that has to be set by the browser. |
@pornel When I try that, I get a 500. |
Try adding The reason is we use browser's own |
Unfortunately, that didn't do it (tried both with content-type header and without it, getting same responses as without .attach(...)). There must be something missing in my request that is maybe related to the API itself. I'll investigate more today. In case you have other suggestion regarding what I can try with superagent, please share. |
Finally solved this, my clients had an API error they were not aware of... sorry for the trouble. |
I've tried building a multipart POST request as described here: http://visionmedia.github.io/superagent/#multipart-requests
This is my code:
Server responds with a bad request - parameter
name
is missing. I know the endpoint works okay because the original is going through a Python app and get a good response, but now I have to reproduce it with superagent.I also tried replacing
.set('Content-Type', 'multipart/form-data')
with.type('form')
and I tried getting rid of.set('Accept', 'application/json')
which gave me a nice 500.I doubt there's an issue with superagent, but I'm wondering if someone could tell me what am I doing wrong?
The text was updated successfully, but these errors were encountered: