Index: http-client.scm =================================================================== --- http-client.scm (revision 27750) +++ http-client.scm (working copy) @@ -690,11 +690,11 @@ (lambda (response) (let ((port (make-delimited-input-port (response-port response) - (header-value 'content-length (response-headers response))))) + (header-value 'content-length (response-headers response)))) + (body? ((response-has-message-body-for-request?) response req))) (if (= 200 (response-class response)) ; Everything cool? - (let* ((b? ((response-has-message-body-for-request?) response req)) - (result (and b? reader (reader port)))) - (when b? (discard-remaining-data! #f port)) + (let ((result (and body? reader (reader port)))) + (when body? (discard-remaining-data! #f port)) result) (http-client-error 'call-with-input-request @@ -712,7 +712,7 @@ ((500) 'server-error) (else 'unexpected-server-response)) 'response response - 'body (read-string #f port)))))))) + 'body (and body? (read-string #f port))))))))) (define (with-input-from-request uri-or-request writer reader) (call-with-input-request uri-or-request