Skip to content

HTTP interface client does not call FormHttpMessageWriter when writing form data #29615

@li0180

Description

@li0180

We are in the process of migrating to Spring 6 and are trying to leverage the new HTTP interface for WebClient. We have a CustomCodec to add form fields to every outbound request (see screenshot). However, it seems to us that this behavior is not working when wrapped with the new HTTP interface.
image

Here is a demo project that reproduces this issue: https://github.com/matthenry87/http-interface-form-fields-codec-bug

If you run the tests in the project, you can see the test that uses WebClient alone works as intended and the test that uses InterfaceClient does not.
image

Additionally, we are also curious about whether we are setting up our MultiValueMap correctly. Spring Docs says we can pass one string value. Does it support passing multiple if they are annotated with @RequestParam?
image

We are using Spring 6 and Spring Boot 3.

Metadata

Metadata

Assignees

Labels

in: webIssues in web modules (web, webmvc, webflux, websocket)type: enhancementA general enhancement

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions