cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Did you get an answer that solved your problem? Please mark it as an Accepted Solution so others with the same problem can find the answer easily. X

REST API call : Content type may not be null

smonteil
1-Newbie

REST API call : Content type may not be null

When calling a ThingWorx native service such as Thingworx/Users/[UserName]/Services/GetOrganizations, the following error is returned: "HTTP 500 - Content type may not be null".

The error is logged in the "Security log", with Origin : S.c.t.s.a.AuthenticationFilter

We use ThingWorx V6.6.0 with a standard install and the test is performed with either Postman or curl.

Any help to fix this issue would be welcome.

Thank you.

Stephane

2 REPLIES 2

I have the same error when calling one of my custom services using Postman REST calls:

http://MYDEVELOPMENTENVIRONMENT/Thingworx/Things/MYTHING/Services/MYSERVICE?appKey=MYAPPKEY&x-thingworx-session=true


Any progress?

liliu
8-Gravel
(To:smonteil)

Hi Stephane & Tim,

Content-Type cannot be null in ThingWorx. It tells the server what kind of result to resqponse to the client. If it's null, server cannot decide which type of result to return to the client.

So in Stephan's use case the URL should be Thingworx/Users/[UserName]/Services/GetOrganizations?method=GET&appKey=...&Content-Type=application/json

And Tim's use case is http://MYDEVELOPMENTENVIRONMENT/Thingworx/Things/MYTHING/Services/MYSERVICE?appKey=MYAPPKEY&x-thingworx-session=true&Content-Type=application/json

Below screenshot is my test result.

Lily

Announcements


Top Tags