title: OpenFeign client doesn't apply "Content-Type" header value: 415 in response
body: <p>I want to perform DELETE using feign:</p>
  
  <pre><code>public static &lt;T&gt; T createClient(Class&lt;T&gt; type) {
      return Feign.builder()
              .client(new OkHttpClient())
              .encoder(new GsonEncoder())
              .decoder(new CustomGsonDecoder())
              .logger(new Slf4jLogger(type))
              .logLevel(Logger.Level.FULL)
              .target(type, url);
  }
  </code></pre>
  
  <p>Method from ConsumersClient interface:</p>
  
  <pre><code>@RequestLine("DELETE /consumers/{id}")
  @Headers({"Content-Type: application/json", "Authorization: Bearer {token}"})
  Response deleteConsumerById(@Param("token") String token, @Param("id") String id);
  </code></pre>
  
  <p>And when I do:</p>
  
  <pre><code>CLIENT = createClient(ConsumersClient.class);
  CLIENT.deleteConsumerById(token, id)
  </code></pre>
  
  <p>And I got</p>
  
  <pre><code>{"statusCode":415,"error":"{\"timestamp\":\"2020-02-27T08:09:33.634Z\",\"status\":415,\"error\":\"Unsupported Media Type\",\"message\":\"Content type '' not supported\",\"path\":\"/consumers/id\"}"}
  </code></pre>
  
  <p>Since the message is: ""Content type '' not supported" I assume that Feign doesn't apply Content-Type value to its headers.</p>
  
  <p><strong>PLEASE NOTE:</strong> Same request via Postman returns 200 with the same parameters. So the service is working as expected.</p>
  
  <p>Logback says the headers are included:</p>
  
  <pre><code>11:09:32.660 [main] DEBUG ConsumersClient - [ConsumersClient#deleteConsumerById] ---&gt; DELETE https://hereGoesMyURL/consumers/id HTTP/1.1
  11:09:32.663 [main] DEBUG ConsumersClient - [ConsumersClient#deleteConsumerById] Content-Type: application/json
  11:09:32.663 [main] DEBUG ConsumersClient - [ConsumersClient#deleteConsumerById] Authorization: Bearer hereGoesTheToken
  11:09:32.664 [main] DEBUG ConsumersClient - [ConsumersClient#deleteConsumerById] ---&gt; END HTTP (0-byte body)
  </code></pre>
  
  <p>Please help to figure out what's wrong with my code.</p>