-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Open
Labels
feedback providedFeedback has been provided to the authorFeedback has been provided to the authorquestionGeneral usage or 'how-to' questionsGeneral usage or 'how-to' questions
Description
jaxrs version: 3.0.7.Final
feign version: 11.10
I want to use @FormParam to pass arguments, and this is my code :
server:
@POST
@Path("/system/authentication/findGroupByUserName")
List<Group> findGroupByUserName(@FormParam("username") String string);
client, service:
@POST
@Path("/system/authentication/findGroupByUserName")
@Headers(value = {" content-type : application/x-www-form-urlencoded "})
List<Group> findGroupByUserName(@FormParam("username") String string);
client feign builder:
Feign.builder()
// required values
.logger(new Slf4jLogger(type))
.client(new ApacheHttpClient(HttpClientUtils.getHttpClient()))
.contract(new JAXRSContract())
.encoder(new JacksonEncoder())
.decoder(new JacksonDecoder())
.options(options);
My JAXRSContract class is copy from feign-jaxrs peoject and I wrote some code so that it can parse the @Headers
annotation.
Now my issue is that the argument usename is encode to json instead of form.
I have traced the code and found the code below : feign.jackson.JacksonEncoder#encode
The data format of the form is: username = '123456', but the data format of the json is {"username":"123456"}. So how can i config the feign builder to make it work , or is there some other solutions.
Thanks !
Metadata
Metadata
Assignees
Labels
feedback providedFeedback has been provided to the authorFeedback has been provided to the authorquestionGeneral usage or 'how-to' questionsGeneral usage or 'how-to' questions