Added check for invalid responses which are not empty. #308
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.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This double checks whether a response from the server was decoded successfully. It additionally checks if there was any response to begin with, to avoid false positives on such operations as ParseFile deletion where no response is returned.
This is in regards to #307 , which has pointed out that https://api.parse.com/ now returns a response indicating the service has shut down. This is returned as plain text, however the Content-type indicates application/octet-stream. As a result the sdk tries to process the request to no avail.
Although noone should be using the old api, this makes a point that the sdk could try to run after an invalid response with the 'right' content type. This change prevents that from occurring.
This does not add tests, as this is an unlikely error in how the sdk handles responses. That and the resulting tests would have to target the old api to replicate this, and that may very well be corrected at some point in the future.