I am using feign version 12.1, Open Feign 3.8.0 to send (POST) requests. It works fine. But the problem is sometimes the user sends XML body messages which shouldn't be.User should always send JSON type messages in the request body and the other type of messages such like XML in the request body should be declined. I tried many things such like adding "Content-Type: application/json" but still I am able to send XML request body type messages. Could you please help me how to avoid sending messages with application/XML format and only accept message body's in application/json format ?
Best
@Headers({"Accept: application/json"})
public interface ExampleApi {
@RequestLine("POST /notifications")
@Headers({"Authorization: Bearer {token}", "X-Flow-ID: {xFlowId}", "Accept: application/json",
"Content-Type: application/json"})
Response postExample(SpNotifications requestBody, @Param("sample") String sample,@Param("sampleId") String sampleId);