-
Notifications
You must be signed in to change notification settings - Fork 38.5k
MockMvcWebTestClient forces HTTP POST for multipart requests #28545
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
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
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
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: