Skip to content

Improve content-type multipart/form-data handling when sending files #59

@bpbecker

Description

@bpbecker

There are 2 issues - a bug and an enhancement.

The Bug

HttpCommand supports sending files using the multipart/form-data content-type. To send a file using just the file name, prefix the name with '@' (similar to how curl works). There is also the option to specify the content-type for the file. With an empty content-type (for the file) HttpCommand would infer the content-type based on the file extension - using 'text/plain' for a .txt file or 'application/octet-stream for anything else. This is actually fine because the payload is just a byte stream. However, if you specify a non-empty content-type (for the file) HttpCommand would produce a malformed request.

The Enhancement

If for some reason you want to pass the file content, as opposed to the file name and having HttpCommand read the file for you, there is no way to specify the name of the file and the content. The enhancement would allow the specification of both so that the server would know what file name to save the content in.

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingenhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions