You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I want to send multipart/form-data request and set Content-Type for each part. curl allows that adding ;type=<content type> for each --form argument. Example from curl manual: curl -F "name=daniel;type=text/foo" example.com
Hurl already allows adding content type for files after ;, but only for files, and without type= keyword.
Support can be emulated saving JSON payload to separate file, but it's a bit tedious to have separate file for each JSON part.
Possibly one could also use multipart forms with a multiline string body, but that would work only for text payloads, and in my case, I want to send a binary file, and some JSON with appropriate content type.
If you save example above to demo.hurl, run netcat to listen on port nc -l -p 8000, and then hurl with hurl --verbose demo.hurl, you will see that hurl sends JSON bits as
Problem to solve
I want to send
multipart/form-data
request and setContent-Type
for each part. curl allows that adding;type=<content type>
for each--form
argument. Example from curl manual:curl -F "name=daniel;type=text/foo" example.com
Proposal
Additional context and resources
Hurl already allows adding content type for files after
;
, but only for files, and withouttype=
keyword.Support can be emulated saving JSON payload to separate file, but it's a bit tedious to have separate file for each JSON part.
Possibly one could also use multipart forms with a multiline string body, but that would work only for text payloads, and in my case, I want to send a binary file, and some JSON with appropriate content type.
If you save example above to
demo.hurl
, run netcat to listen on portnc -l -p 8000
, and then hurl withhurl --verbose demo.hurl
, you will see that hurl sends JSON bits asbut hurl also informs that this request can be run with
which sends
which is a quite funny discrepancy. Shame one cannot exploit it forcing hurl to invoke curl binary instead of using curl library.
The text was updated successfully, but these errors were encountered: