Skip to content

curl multipart/form-data snippet includes unwanted boundary  #226

@nateslo

Description

@nateslo

The snippet generated for a multipart form data request for curl includes a boundary in the headers. curl appends it own boundary header, resulting in two boundaries and the request fails.

Example snippet generated (with the addition of the verbose flag):

curl --request POST \
  --url https://mockbin.org/echo \
  --header 'Content-Type: multipart/form-data; boundary=---011000010111000001101001' \
  --header 'accept: application/json' \
  --form 'filename=@nyancat32x32.png;type=image/png' \
  -v

We can see that the request was sent with double boundaries, one from httpsnippet, and one added by curl:

 Content-Type: multipart/form-data; boundary=---011000010111000001101001; boundary=------------------------c18ea9ee9be9cb74

As far as I can tell, httpsnippet always adds the boundary=---011000010111000001101001' to every multipart/form-data request. Any ideas of a way around this?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions