Uploading multipart/form-data with Boundary #199

Closed
unbalancedparentheses opened this Issue Jan 30, 2014 · 2 comments

Comments

Projects
None yet
3 participants

I couldn't find a way of uploading a multipart/form-data file that has a particular Boundary.

In curl I would do:
curl -vX POST http://localhost:4000/images -u 13:13 -H "Content-Type: multipart/form-data; Boundary=---XXX---" --data-binary @multipart

Is this supported by httpie?

Thanks in advance

It isn't supported by httpie likely because it isn't directly supported by requests (not in a nice way at least).

Owner

jakubroztocil commented Apr 10, 2014

@pyotrgalois Does the ./multipart file contains the payload including the boundary? If yes, then you can use this command to upload the data from the file and specify the boundary in the Content-Type header:

$ http -v localhost:4000/images \
    'Content-Type: multipart/form-data; Boundary=---XXX---'  < ./multipart

@rocketraman rocketraman added a commit to rocketraman/spring-restdocs that referenced this issue Mar 7, 2016

@rocketraman rocketraman Add httpie snippet support
NOTES:

* Httpie does not currently support setting the content type for each
  part in a multipart form -- these multipart types are currently
  ignored. See:

  jakubroztocil/httpie#199
  jakubroztocil/httpie#271
  jakubroztocil/httpie#285
  jakubroztocil/httpie#398

* There is an issue with specifying piped input for multipart form data.
  There is no way currently to specify the data without specifying a
  filename parameter in the Content-Disposition. For now, this is
  ignored. See:

  jakubroztocil/httpie#342
ad29b38

@rocketraman rocketraman added a commit to rocketraman/spring-restdocs that referenced this issue Mar 7, 2016

@rocketraman rocketraman Add httpie snippet support
NOTES:

* Httpie does not currently support setting the content type for each
  part in a multipart form -- these multipart types are currently
  ignored. See:

  jkbrzt/httpie#199
  jkbrzt/httpie#271
  jkbrzt/httpie#285
  jkbrzt/httpie#398

* There is an issue with specifying piped input for multipart form data.
  There is no way currently to specify the data without specifying a
  filename parameter in the Content-Disposition. For now, this is
  ignored. See:

  jkbrzt/httpie#342
234ce78

@rocketraman rocketraman added a commit to rocketraman/spring-restdocs that referenced this issue Mar 7, 2016

@rocketraman rocketraman Add httpie snippet support
NOTES:

* Httpie does not currently support setting the content type for each
  part in a multipart form -- these multipart types are currently
  ignored. See:

  jakubroztocil/httpie#199
  jakubroztocil/httpie#271
  jakubroztocil/httpie#285
  jakubroztocil/httpie#398

* There is an issue with specifying piped input for multipart form data.
  There is no way currently to specify the data without specifying a
  filename parameter in the Content-Disposition. For now, this is
  ignored. See:

  jakubroztocil/httpie#342
dae49ff

@rocketraman rocketraman added a commit to rocketraman/spring-restdocs that referenced this issue Mar 7, 2016

@rocketraman rocketraman Add httpie snippet support
NOTES:

* Httpie does not currently support setting the content type for each
  part in a multipart form -- these multipart types are currently
  ignored. See:

  jkbrzt/httpie#199
  jkbrzt/httpie#271
  jkbrzt/httpie#285
  jkbrzt/httpie#398

* There is an issue with specifying piped input for multipart form data.
  There is no way currently to specify the data without specifying a
  filename parameter in the Content-Disposition. For now, this is
  ignored. See:

  jkbrzt/httpie#342
7d1238d

@wilkinsona wilkinsona added a commit to spring-projects/spring-restdocs that referenced this issue Mar 9, 2016

@rocketraman @wilkinsona rocketraman + wilkinsona Add support for generating an HTTPie snippet
This commit adds support for generating a snippet that contains
the HTTPie command for the request. As the snippet does not require
any additional configuration, it has added to the existing default
snippets.

Httpie does not currently support setting the content type for each
part in a multipart form -- these multipart types are currently
ignored. See:

    jkbrzt/httpie#199
    jkbrzt/httpie#271
    jkbrzt/httpie#285
    jkbrzt/httpie#398

There is an issue with specifying piped input for multipart form
data. There is no way currently to specify the data without specifying
a filename parameter in the Content-Disposition. For now, this is
ignored. See:

    jkbrzt/httpie#342

See gh-207
b26d8c0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment