How to resolve error 415 Unsupported Media Type when Content-Type is correctly set

后端 未结 3 1935
慢半拍i
慢半拍i 2021-01-15 19:10

I have a simple POST request that requires a json Content-Type header and a body like

{
   oneNbr: \"2016004444\",
   twoCode: \"@@@\",
   threeNbr: \"STD PA         


        
3条回答
  •  情书的邮戳
    2021-01-15 19:34

    We did some debugging and found that Karate automatically appends 'charset=UTF-8' to the Content-Type header. The API does not expect charset.

    Found the following post and that solved the problem:

    How can I send just 'application/json' as the content-type header with Karate?

    Posting this to help others in future.

提交回复
热议问题