Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

Unsupported media type error while creating a work item in JazzHub using OSLC REST APIs

I am attempting to create a work item in Bluemix's Track & Plan or JazzHub using OSLC REST APIs. Here's my curl command:

curl -X POST https://hub.jazz.net/ccm34/oslc/contexts/_ydaKxAtiEeao2prjBQrN8g/workitems -H "Accept:application/x-oslc-cm-change-request+json" -L -i -H "OSLC-Core-Version:2.0" -u"name:password" -d '{"dc:title":"test curl title", "dc:description":"test curl summary", "dc:type":{"rdf:resource":"https://hub.jazz.net/ccm34/oslc/types/_ydaKxAtiEeao2prjBQrN8g/task"},"rtc_cm:filedAgainst":{"rdf:resource":"Unassigned"}}'

I am following the guidelines to make the accept header to be of type 'application/x-oslc-cm-change-request+json'. My response shows up as this (see below). Tried both xml as well as application/json and did not work. Any idea why this POST request is failing? Also tried setting the content-type header and got the same error.

HTTP/1.1 415 Unsupported Media Type Date: Fri, 06 May 2016 22:14:20 GMT Server: Apache X-Powered-By: Servlet/3.0 Expires: Fri, 06 May 2016 22:14:21 GMT Content-Language: en-US Content-Length: 0 Cache-Control: private, must-revalidate, max-age=0, no-cache=set-cookie Set-Cookie: ....

0 votes



One answer

Permanent link
Which document are you referring to? You specified the "Accept" header which only affects what content you will _receive_. You need to specify the "Content-Type" header to tell the server you are sending JSON format.

0 votes

Your answer

Register or log in to post your answer.

Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 10,954

Question asked: May 09 '16, 1:51 p.m.

Question was seen: 2,058 times

Last updated: May 09 '16, 8:26 p.m.

Confirmation Cancel Confirm