Monday, September 12, 2016

Salesforce REST API: Unable to read request: No content to map to Object due to end of input

While working on an integration with the Salesforce REST API, I was working with their batch API and ran into this error message:

Unable to read request: No content to map to Object due to end of input

At first I assumed this was because I wasn't passing something I should have been, but it turned out that I was passing something it didn't like. I removed fields from my payload that I wasn't completely sure about and it suddenly started working for me. Hope this helps someone else in the same bind.

1 comment:

Ashok said...

Hi. I am trying to post request through some intergration tool informatica and getting same error though i use default- 'application/JSON' and Content- Type. i' am sending two fields as below
{
"id:"cccc"
"email":"[email protected]
}

I am using simple post method in http geting below error
[{"errorCode":"APEX_ERROR","message":"System.JSONException: No content to map to Object due to end of input\n\n(System Code)\nClass.accountOwnerChange.ownerUpdateonAcc: line 9, column 1"}]