OpenFeign/feign

Can't set Content-type for Request Header when use Spring annotations

Open

#1,239 opened on Jun 10, 2020

View on GitHub
 (9 comments) (5 reactions) (0 assignees)Java (9,070 stars) (1,911 forks)batch import
bughelp wantedneeds info

Description

I'm using Feign and Spring annotations, I have a request that expects to accept "text/plain".

@PostMapping(value = "/demo", consumes = "application/json", produces="text/plain")
public String demo(@RequestBody List<Long> ids);

But, the produces value not working. The request still has a header: Accept=application/json

Contributor guide