krish
krish

Reputation: 81

Error 415 Unsupported Media Type while executing list REST API from post man

I am using List REST API for loading Party data. Using the details below:

Request type : POST
URL : http://localhost:1512/rest/V1.0/list/Party
Authorization : Yes
Header : No Header information
Body : form Data ->xml file.

When I send request I am getting below error. Can you please help me.

http-equiv="Content-Type" content="text/html;charset=ISO-8859-1"/>
Error 415 Unsupported Media Type

Upvotes: 8

Views: 56754

Answers (3)

SaamTehraani
SaamTehraani

Reputation: 355

In my case for PUT call, I set Body to "raw" and added "Content-Type" to "application/json"

enter image description here

Upvotes: 12

gustavo herrera
gustavo herrera

Reputation: 51

In my case, I was creating a Web API 2.1 project in VS 2017 and I got the same problem. I just should disable SSL. The route to disable is right click on name project > properties > Debug > Anable SSL.

enter image description here

Upvotes: 0

jhovanec
jhovanec

Reputation: 866

You will need to include a header in your post request. Add a value under headers in Postman to include a key for Content-Type with a value of application/xml. You may also want to try a value of text/xml depending on what your body content is.

Here's a link for info on the difference between text/xml and application/xml.

Upvotes: 8

Related Questions