Forum Discussion

codydearkland_2's avatar
codydearkland_2
Icon for Nimbostratus rankNimbostratus
Jun 08, 2016

Error - POSTMAN REST Client - Google Chrome - "Found invalid content-type. The content-type must be application/json" - Header IS set

Weirdest thing...

 

I'm using POSTMAN to work with the REST Interface on the F5's and im having a heck of a time getting stuff to post.

 

I've set the content-type header to application/json. No dice, I just keep getting - {"code":415,"message":"Found invalid content-type. The content-type must be application/json. The received content-type is 10e18c4c-e066-0ab4-74bd-aa578954ae61","errorStack":[]}

 

Any thoughts? my JSON object is...

 

{ "name": "10.0.0.2:80", "address": "10.0.0.2", "ratio": "1" }

 

I'm able to do that using CLI tools, just not using POSTMAN. Wondering if anyone else has had this problem, and has any nice work arounds for it?

 

  • FIXED! The issue seems to have been caused by the Postman-Token header confusing the F5 (you can see it using chrome tools network tab) . Somehow the F5 was treating the Postman-Token as the Content-Type header. Disable the Postman-Token header (Settings > General > Headers > "Send Postman Token header") and the request gets through.

     

    You can see the purpose of the Postman-token header here https://www.getpostman.com/docs/settings

     

    Enable chrome tools for postman http://blog.getpostman.com/2014/01/27/enabling-chrome-developer-tools-inside-postman/

     

  • Hi,

     

    sounds it's a bug, if you have a deep look at postman request, you will probably see that by default it set the content type to application/xml. You need to manually specify the Content-Type header with application/json value.

     

    • Andrew_Pinder_2's avatar
      Andrew_Pinder_2
      Icon for Altostratus rankAltostratus
      I have inspected the Postman request with the chrome tools network debugger and the Content-Type header certainly looks to be set - but i am getting the same Content-Type error The error message is "The content-type must be application/json. The received content-type is 7f007420-1b79-d546-b274-dbe86805277e" which is the value of the header Postman-Token: "7f007420-1b79-d546-b274-dbe86805277e". Hmmmm
  • Hi,

     

    sounds it's a bug, if you have a deep look at postman request, you will probably see that by default it set the content type to application/xml. You need to manually specify the Content-Type header with application/json value.

     

    • Andrew_Pinder_2's avatar
      Andrew_Pinder_2
      Icon for Altostratus rankAltostratus
      I have inspected the Postman request with the chrome tools network debugger and the Content-Type header certainly looks to be set - but i am getting the same Content-Type error The error message is "The content-type must be application/json. The received content-type is 7f007420-1b79-d546-b274-dbe86805277e" which is the value of the header Postman-Token: "7f007420-1b79-d546-b274-dbe86805277e". Hmmmm
  • FIXED! The issue seems to have been caused by the Postman-Token header confusing the F5 (you can see it using chrome tools network tab) . Somehow the F5 was treating the Postman-Token as the Content-Type header. Disable the Postman-Token header (Settings > General > Headers > "Send Postman Token header") and the request gets through.

     

    You can see the purpose of the Postman-token header here https://www.getpostman.com/docs/settings

     

    Enable chrome tools for postman http://blog.getpostman.com/2014/01/27/enabling-chrome-developer-tools-inside-postman/