Skip to content
This repository has been archived by the owner on Nov 8, 2024. It is now read-only.

What's the status on multipart/form-data requests support? #376

Closed
vnenkpet opened this issue Jan 31, 2017 · 4 comments
Closed

What's the status on multipart/form-data requests support? #376

vnenkpet opened this issue Jan 31, 2017 · 4 comments

Comments

@vnenkpet
Copy link

We just run into na issue where when we have request such as

+ Request

    + Headers

            Content-Type: multipart/form-data; boundary=BOUNDARY
            
    + Body
    
            --BOUNDARY
            Content-Disposition: form-data; name="name"

            John Doe
            --BOUNDARY
            Content-Disposition: form-data; name="email"

            [email protected]
            --BOUNDARY--

we are not able to run succesfully it in the apiary console on app.apiary.io against our own endpoint because we are getting

{
  "message": "Unexpected end of multipart data"
}

back as a response from the server (running Node.js using async-busboy package to handle multipart requests), however we know this end-point works correctly when we use it vith Postman or HTML form handled with JQuery or curl.

Is this a bug, or are these requests simply not supported, or is there something wrong with the .apib code snippet above?

I know there are issues related to multipart handling but I can't find a solid info about the current status of multipart/form-data support in Blueprint.

@zdne
Copy link
Contributor

zdne commented Feb 11, 2017

@vnenkpet I think you have the inconsistent boundary there: BOUNDARY vs --BOUNDARY vs --BOUNDARY-- .

See http://stackoverflow.com/questions/24207495/how-do-i-document-a-multipart-request-with-apiary

@FranklinYu
Copy link

@zdne So the format in the body section is not what actually gets sent? In HTML specification the last boundary should be --BOUNDARY--.

@kylef
Copy link
Member

kylef commented Jan 11, 2019

The request body as-is is what should be sent, the parser should not modify the contents.

I would take a guess the problem might be with the line endings themselves, as the markdown document will only contain a new line. Whereas multipart form implementations may expect a carridge return and a new line. I believe some tooling such as Dredd will automatically convert these newlines in multipart responses to contain a carriage return.

@kylef
Copy link
Member

kylef commented Jan 11, 2019

This problem is tracked via #401

@kylef kylef closed this as completed Jan 11, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants
@kylef @zdne @vnenkpet @FranklinYu and others