-
Notifications
You must be signed in to change notification settings - Fork 58
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
imposter-3.22.0.jar - REST request with content-type=multipart/form-data - how to access the parts ? Groovy script returns null body #575
Labels
Comments
Hi @rcoulonv, thanks for raising this. Here's an example using Imposter 3.40: Testing the mock:
The script prints the following in the log:
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I am using Java jdk-11.0.22 to run imposter-3.22.0.jar --plugin rest
How is it possible to retrieve using a Groovy script the parts of a REST request whose content-type=multipart/form-data ?
The Groovy script returns a null body while the content-length=48199 - see below:
Groovy script extract:
logger.info "DEBUG - context.request = " + context.request
logger.info "DEBUG - context.request.body = " + context.request.body
logger.info "DEBUG - context.request.formParams = " + context.request.formParams
Log console extract at execution
10:51:26 INFO s.r.a.s.c.v1 - DEBUG - context.request = Request{path='/myapi', method='POST', uri='http://127.0.0.1:8080/myapi', pathParams={}, queryParams={}, headers={mime-version=1.0, content-length=48199, host=127.0.0.1:8080, content-type=multipart/form-data; boundary="----=_Part_86_1037032677.1716281485976", connection=Keep-Alive, accept-encoding=gzip,deflate,br, user-agent=Apache-HttpClient/4.5.14 (Java/17.0.10)}, body=}
10:51:26 INFO s.r.a.s.c.v1 - DEBUG - context.request.body = null
10:51:26 INFO s.r.a.s.c.v1 - DEBUG - context.request.formParams = [:]
Thanks for your support
The text was updated successfully, but these errors were encountered: