The Facebook API returns JSON with a Content-Type of text/javascript. This makes AFJSONRequestOperation error, since it's expecting text/json or application/json. Seems reasonable for AFJSONRequestOperation to accept text/javascript, since JSON is a subset of JavaScript.
These days, I can't honestly tell if Facebook actually has a good reason to send as text/javascript (compatibility with terrible, old clients?), but FB is a sufficiently large use-case to support by default, and I agree that this should be added. Thanks for the patch, Jake!
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.
jakeboxer commentedDec 11, 2011
The Facebook API returns JSON with a Content-Type of
text/javascript. This makesAFJSONRequestOperationerror, since it's expectingtext/jsonorapplication/json. Seems reasonable forAFJSONRequestOperationto accepttext/javascript, since JSON is a subset of JavaScript.