+ Start a Discussion
Kahlil DozierKahlil Dozier 

Unable to get "content" or "rendition" of a file- always returns "Processing response content failed?"


I'm building an iOS app using the chatter API and mobile SDK's, and am trying to access files posted as attachments to a user's news feed.  However, whenever I create a REST request trying to get the file content or file renditions resources, the REST request fails with an error of "Processing response content failed."  For reference here are the endpoints I'm trying to hit:

 Any idea what may be causing this to happen?  For reference I'm trying to get the content of a PDF image that has been posted as an attachment to a news feed item.  I can use the chatter API to view the file information just fine but I get the error when specifically trying to get one of these two resources. 
Best Answer chosen by Kahlil Dozier
Kahlil DozierKahlil Dozier
Found the answer- I was sending the REST requests using the SFRestRequest class.  Apparently that class has a property, "parseResponse", which is set to YES by default.  This means it will assume the incoming data is in the form of JSON and try to parse it.  However, in this case the incoming data is in the form of a binary stream, and I needed to set the "parseResponse" property to NO.  Now I successfully get an NSData object back in the SFRestDelegate.