Check the HTTP response data for nullness

Although it should not happen, it looks like the response data from a
successful HTTP request may be incorrect (for example because the
connection was dropped before the whole body was received).

Also, not being able to get the result is not necessarily an error. We
will log it as a warning, and let the caller determine how it should be
handled.

Note that we removed the whitespace substitution in the process. The
JSON body should already be well formed, and does not need any massaging
before being used.