415: Unsupported Media Type returned when making a POST call with REST

book

Article ID: 38139

calendar_today

Updated On:

Products

SUPPORT AUTOMATION- SERVER CA Service Desk Manager - Unified Self Service KNOWLEDGE TOOLS CA Service Management - Asset Portfolio Management CA Service Management - Service Desk Manager

Issue/Introduction

Issue

When making a POST call with RESTful web services I receive:

"415: Unsupported Media Type"

  

Environment: 

-Service Desk Manager 12.7 or later
 

Cause:

-REST returns standard HTTP error codes
-415: Unsupported Media Type is defined as "The server is refusing to service the request because the entity of the request is in a format not supported by the requested resource for the requested method."
-This error is received when the Content-Type of the Body/Payload is not defined in the POST Headers as 'application/xml'
 
 

 

Resolution

-In the Headers of the POST call specify "Content-Type: application/xml"
-Below is a an example POST call made with a REST client in Chrome:
 
 

<Please see attached file for image>

REST_ContentType.png

 

Additional Information:  

-For Service Desk Manager 12.9 and below, more information about RESTful web services can be found in the Technical Reference Guide under Chapter 7: Web Service Methods>REST HTTP Methods
-For Service Desk Manager 14.1, more information can be found in the Service Management Wiki

Environment

Release: SDMU0M99000-14.1-Service Desk Manager-Full License
Component:

Attachments

1558723768130000038139_sktwi1f5rjvs16wza.png get_app