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: Konrad Mathieu via curl-users <>
Date: Mon, 11 May 2020 18:41:34 +0200

Thanks Rainer! If only I had access to their server. All they gave me
was an IP and port number, so I can't change their response header. (it
is one of those places where 3 devs are surrounded by 30 bs-jobs;)

Fortunately, this implementation is for one client only, but that is of
little comfort. I am trying to accomodate the behavior in the write
callback now as Daniel pointed out, using that a bit like a plugin. It
will not necessarily look very elegant in the end, but what can you do.


On 11.05.2020 13:46, Rainer Canavan via curl-users wrote:
> On Sun, May 10, 2020 at 11:18 AM Konrad Mathieu via curl-users
> <> 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:
> Etiquette:
Received on 2020-05-11