Home:ALL Converter>Apiary multipart/form-data

Apiary multipart/form-data

Ask Time:2017-01-31T22:18:02         Author:Petr Vnenk

Json Formatter

I have tried creating an Apiary request with multipart/form-data, which seems alright, except when I try actually sending it via the console on Apiary to an existing (and functional) endpoint written in Node.js using async-busboy I'm getting back

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

The Apiary Blueprint for this request looks like this:

+ 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--

I'd like to know if there is any problem that can be fixed in the Blueprint snippet or if this is even supported, or if the problem might be in the server itself (but the server works when I send a multipart post request from postman, curl and there are also few client implementations using it)

Author:Petr Vnenk,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/41959859/apiary-multipart-form-data
yy