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

后端 未结 3 1936
慢半拍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:58

    Try adding a * header Accept = 'application/json' header. The one difference between Karate and Postman is that Postman tries to be smart and auto-adds an Accept header - whereas Karate does not.

提交回复
热议问题