huandu/facebook — pull request #14 by dinedal (2014-09-01 00:02:04+00:00)
Title: Add support for when FB returns not JSON as a response in a JSON api

When issuing a `DELETE` request, FB may decide to not return valid JSON, and instead return `[]byte("true")`

Since Go won't un-marshall this into a `map[string]interface{}` and a huge change of the entire package would be required to make `Result` behave as both a `map[string]interface{}` and a `bool` I decided to make the compromise, if FB responds this way, I set a key `"success"` to `"true"` as an attempt to find some middle ground here.

Example FB API calls that result in non JSON being returned:

- Delete audience https://developers.facebook.com/docs/reference/ads-api/custom-audience-website
- Removing ad accounts from an ad account group https://developers.facebook.com/docs/reference/ads-api/adaccountgroup
- Delete the ad campaign https://developers.facebook.com/docs/reference/ads-api/adcampaign