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
MockMvcWebTestClient forces HTTP POST for multipart requests #28545
Labels
in: test
Issues in the test module
in: web
Issues in web modules (web, webmvc, webflux, websocket)
type: enhancement
A general enhancement
Milestone
Comments
spring-projects-issues
added
the
status: waiting-for-triage
An issue we've not yet triaged or decided on
label
May 31, 2022
sbrannen
added
in: test
Issues in the test module
in: web
Issues in web modules (web, webmvc, webflux, websocket)
labels
May 31, 2022
rstoyanchev
added
type: enhancement
A general enhancement
and removed
status: waiting-for-triage
An issue we've not yet triaged or decided on
labels
Jun 1, 2022
rstoyanchev
changed the title
WebTestClient multipart request forces POST method
MockMvcWebTestClient forces HTTP POST for multipart requests
Jun 1, 2022
Indeed, it looks like MockMvc doesn't have methods in |
Apologies for the potential spam but really wanted to leave my thanks for taking care of this, keep up the good work! 👍 |
izeye
added a commit
to izeye/spring-framework
that referenced
this issue
Jun 15, 2022
sbrannen
pushed a commit
to sbrannen/spring-framework
that referenced
this issue
Jun 15, 2022
izeye
added a commit
to izeye/spring-framework
that referenced
this issue
Jun 15, 2022
sdeleuze
pushed a commit
to sdeleuze/spring-framework
that referenced
this issue
Feb 7, 2023
sdeleuze
pushed a commit
to sdeleuze/spring-framework
that referenced
this issue
Feb 7, 2023
sdeleuze
pushed a commit
to sdeleuze/spring-framework
that referenced
this issue
Feb 7, 2023
mdeinum
pushed a commit
to mdeinum/spring-framework
that referenced
this issue
Jun 29, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
in: test
Issues in the test module
in: web
Issues in web modules (web, webmvc, webflux, websocket)
type: enhancement
A general enhancement
Affects: latest (6.0.0, 5.3.20)
When making a
multipart/form-data
request usingWebTestClient
, the HTTP method of the request is overwritten toPOST
:For example, the following test:
generates the following log output:
I've traced this to a some code that implies that Multipart requests are always
POST
:spring-framework/spring-test/src/main/java/org/springframework/test/web/servlet/request/MockMultipartHttpServletRequestBuilder.java
Line 81 in 279f964
spring-framework/spring-test/src/main/java/org/springframework/test/web/servlet/client/MockMvcHttpConnector.java
Line 157 in 279f964
The text was updated successfully, but these errors were encountered: