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

REST API call : Content type may not be null

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
Highlighted

Re: REST API call : Content type may not be null

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-thingw...


Any progress?

Re: REST API call : Content type may not be null

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-thingw...

Below screenshot is my test result.

Lily