I developed a Workflow that uses http call webservice in our devlopment site on O365. When I rebuilt the identical workflow in production, it fails with the error:

System.IO.InvalidDataException: Unable to deserialize HTTP response content. Expected ContentType : 'application/json', 'text/plain' or 'text/html', Received ContentType : 'application/atom+xml'

This indicates to me that the headers that specify Json response are not getting to SharePoint.

I am setting the request headers in both calls the same - and the log shows the values are the same in both: {"Accept":"application\/json;odata=verbose","Content-Type":"application\/json;odata=verbose"}

What could be different in the two environments - and what would I have to change to make it work in production?


A co-worker ran across this issue, and I found the resolution to it on another site. It boils down to this:

"To resolve this issue we need to pass Accept and Content-Type as application/json;odata=verbose to both the response headers and request headers. This way we will get JSON response."

For a full explanation and walk-through, please see Prasad Pathak's Technology Blog post on this from Feb 2015. SharePoint 2013: Desinger workflow error with 'Call HTTP web service' action.

  • Great answer with great link to solution. It solved my problem. Thank you – David Repka Nov 11 '16 at 13:43

Just in case the accepted answer fix does not work -

I too had ran into this issue. In my code, I verified the point mentioned in the accepted answer but that was not the mistake which I had made.

So on further investigation, I realized that there were some look-up columns used in the list which was being queried using REST api. The correction required for was that a select condition was needed to be added in the REST url for making the fix.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.