close body only if the http request did not fail