New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
JMeter failing for multipart/form body #137
Comments
Seems Rserve convert the boundary string to lower case when write the curl -v \
-X POST \
-H "Content-Type: multipart/form-data; boundary=AAAAA" \
-d $'--AAAAA\r\nContent-Disposition: form-data; name="example"\r\n\r\ntest\r\n--AAAAA--\r\n' \
http://127.0.0.1:8001 From the Rserve: HEADERS:
Request-Method: POST
Host: 127.0.0.1:8001
User-Agent: curl/7.69.1
Accept: */*
Content-Type: multipart/form-data; boundary=AAAAA
Content-Length: 76
QUERY:
NULL
BODY:
raw [1:76] 2d 2d 41 41 ...
- attr(*, "content-type")= chr "multipart/form-data; boundary=aaaaa" JMeter use uppercase symbols in the boundary. But |
With curl -v -H "Content-Type: multipart/form-data; boundary=AAAAA" -d $'--AAAAA\r\nContent-Disposition: form-data; name="example"\r\n\r\ntest\r\n--AAAAA--\r\n' http://127.0.0.1:8080/echo
* Trying 127.0.0.1:8080...
* Connected to 127.0.0.1 (127.0.0.1) port 8080 (#0)
> POST /echo HTTP/1.1
> Host: 127.0.0.1:8080
> User-Agent: curl/7.69.1
> Accept: */*
> Content-Type: multipart/form-data; boundary=AAAAA
> Content-Length: 76
>
* upload completely sent off: 76 out of 76 bytes
* Mark bundle as not supporting multiuse
< HTTP/1.1 200 OK
< Content-type: application/json
< Server: RestRserve/0.2.1
< Content-length: 322
<
* Connection #0 to host 127.0.0.1 left intact
{"path":"/echo","headers":{"content-length":"76","host":"127.0.0.1:8080","user-agent":"curl/7.69.1","accept":"*/*","content-type":"multipart/form-data; boundary=AAAAA"},"parameters":{"query":{},"body":{"example":"test"},"path":[]},"body":{"attributes":{"content-type":"multipart/form-data; boundary=aaaaa"},"rtpye":"raw"}} |
* Rename C++ exported functions (add cpp_ prefix) * Change boundary generation for the tests * Fix boundary parsing and matching * Add echo demo app * Add test for the Request$set_id * Wrap BackendRserve$start with nocov * Fill Request content-type from headers only if empty (fix tests fail) * Use ASCII to generate boundary for the tests * Simulate Rserve behaviour for multipart body in test
@rplati, can you test again with remotes::install_github("rexyai/RestRserve@dev") |
@artemklevtsov, I can confirm that the issue has been resolved, thank you! |
@rplati on CRAN now |
Hi, first of all thanks for your work on this package! I got it working and it looks very promising.
I was unable to test my API with JMeter due to tests failing when the API accepts multipart/form data.
I suspect this might be because the boundary that JMeter uses that does not start with double dash signs (--). It seems
parse_multipart_body
cannot handle that. When I submit the same call with Postman (boundary starts with --), everything works.Partial JMeter log:
The text was updated successfully, but these errors were encountered: