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 have been having issues using Verb for multipart requests. When trying to use to make requests to a Eclipse Jetty server I was having two kinds of issues:
If I was using a "big" file, such as a PDF, it would throw an exception with the message: "Header section has more than 10240 bytes (maybe it is not properly terminated)";
If I was using a small text file the exception message changed to: "Stream ended unexpectedly".
but instead the response I get doesn't have anything under the "files" key (also regardless of using CLRF as newline).
Using Postman
For testing purposes, I decided to try out the same request on Postman. Roughly the same request on both my web server and HTTPBin work fine on Postman. Here's how Postman formats the HTTPBin request
and it is similar with my own server's request, just changing the Host header.
Closing thoughts
I have a theory that this issue is mainly caused by the lack of a space between the Content-Type: text/plain and the data from the file, but I'm not sure if that's the case on the final request, but I can observe it when exporting the requests to either Verb or cURL formats, as shown bellow
POST https://httpbin.org/postUser-Agent: Verb 2.15.0 on Emacs 28.2Content-Type: multipart/form-data; boundary=NyiMgyfrP5nE1nvdFaG2oFNcu1NtrJjsxnFMbtDZCSEU1gjOhTiqbGnZ8tWTiecz--NyiMgyfrP5nE1nvdFaG2oFNcu1NtrJjsxnFMbtDZCSEU1gjOhTiqbGnZ8tWTieczContent-Disposition: form-data; name="file"; filename="foo"Content-Type: text/plaintesting--NyiMgyfrP5nE1nvdFaG2oFNcu1NtrJjsxnFMbtDZCSEU1gjOhTiqbGnZ8tWTiecz--
The problem
I have been having issues using Verb for multipart requests. When trying to use to make requests to a Eclipse Jetty server I was having two kinds of issues:
Steps to reproduce
The request I was using is the following:
where
/tmp/foo
's content is simplytesting
. And the problem occurs regardless of using\r\n
as newline.I also tried doing requests to HTTPBin to see if it was a problem with my server's setup. I constructed the request as follows
The expected result is
but instead the response I get doesn't have anything under the
"files"
key (also regardless of using CLRF as newline).Using Postman
For testing purposes, I decided to try out the same request on Postman. Roughly the same request on both my web server and HTTPBin work fine on Postman. Here's how Postman formats the HTTPBin request
and it is similar with my own server's request, just changing the
Host
header.Closing thoughts
I have a theory that this issue is mainly caused by the lack of a space between the
Content-Type: text/plain
and the data from the file, but I'm not sure if that's the case on the final request, but I can observe it when exporting the requests to either Verb or cURL formats, as shown bellowThe text was updated successfully, but these errors were encountered: