curl / Mailing Lists / curl-library / 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: Curl vs libcurl

From: Patrick Schlangen via curl-library <curl-library_at_lists.haxx.se>
Date: Wed, 20 Oct 2021 09:52:47 +0000

Am 20.10.2021 um 11:38 schrieb Brian Meekings via curl-library <curl-library_at_lists.haxx.se>:
> The GET request looks the same in both to me, so why does one succeed, and the other fail? I'd really appreciate it if anyone can shed any light on this.

The difference is that the curl request has the User-Agent header set. The server you're talking to seems to require it to be set. You can verify it by:

% curl -k "http://www.idi-middleware.com/" -H 'User-Agent:'
<html>
<head><title>400 Bad Request</title></head>
<body>
<center><h1>400 Bad Request</h1></center>
<hr><center>openresty/1.17.8.2</center>
</body>
</html>

Your libcurl request should succeed once you add that header there.

Best,

Patrick

-- 
Unsubscribe: https://lists.haxx.se/listinfo/curl-library
Etiquette:   https://curl.haxx.se/mail/etiquette.html
Received on 2021-10-20