cURL / Mailing Lists / curl-users / Single Mail

curl-users

How to skip the proxy response message?

From: Desmond O. Chang <dochang_at_gmail.com>
Date: Fri, 20 Nov 2015 13:09:49 +0800

Hi all,

I need to access a REST API and parse the response behind a proxy. It's hard to
detect the header part in the response.

E.g., run the following command:

    curl --silent --include https://httpbin.org/get

Without a proxy, the response is:

```
HTTP/1.1 200 OK
Content-Type: application/json
{headers}...

{body}...
```

Behind a proxy, the response is:

```
HTTP/1.1 200 Tunnel established

HTTP/1.1 200 OK
Content-Type: application/json
{headers}...

{body}...
```

I think it would be better to make curl hide the proxy response, rather than
hacking the parse script.

Is there any way to do that? Or, is it possible to add an option for that
purpose?

Regards,
Des
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-users
FAQ: http://curl.haxx.se/docs/faq.html
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2015-11-20