curl / Mailing Lists / curl-users / Single Mail
Buy commercial curl support from WolfSSL. We help you work out your issues, debug your libcurl applications, use the API, port to new platforms, add new features and more. With a team lead by the curl founder himself.

Re: How to handle a response with an empty body

From: Rainer Canavan via curl-users <curl-users_at_cool.haxx.se>
Date: Mon, 11 May 2020 13:46:48 +0200

On Sun, May 10, 2020 at 11:18 AM Konrad Mathieu via curl-users
<curl-users_at_cool.haxx.se> wrote:
>
> Hello and thanks very much for having me!
>
> I am writing an implementation of an xml based interface. Unfortunately,
> whoever wrote the interface designed one of its function to only return
> a body on errors.

The design is perfectly all right, but the implementation on the
server side is
lacking. Just add a "Content-Length: 0" Header, implement chunked transfer-
encoding or use HTTP/1.0 with "Connection: close" and actually close the
connection after the headers have been transferred. If you fix the server,
you won't have to work around those problems with all possible clients.

rainer
-----------------------------------------------------------
Unsubscribe: https://cool.haxx.se/list/listinfo/curl-users
Etiquette: https://curl.haxx.se/mail/etiquette.html
Received on 2020-05-11