I use curl in php to make whois requests. Most of the time this works fine, but the occasional whois server rejects curl requests because they use an invalid format.
This is a working example:
curl -X "who-is.ga" whois.my.ga:43
This on the other hand does not work:
curl -X "ikea.eu" whois.eu:43
The EU whois server rejects the format, because (it appears) to include all the headers in the request, ie:
WHOIS ikea.eu / HTTP/1.1User-Agent: curl/7.19.7 (x86_64-redhat-linux-gnu) libcurl/7.19.7 NSS/3.21 Basic ECC zlib/1.2.3 libidn/1.18 libssh2/1.4.2Host: whois.eu:43Accept: /
While most whois servers parse the request until \r\n, some take the entire request into account.
So I thought to remove the additional headers, but was only able to remove the user agent and host.
curl -X "ikea.eu" --header "Host:" --header "Accept:" --user-agent "" whois.eu:43
But the headers "/" and "HTTP/1.1" remain.
% WHOIS ikea.eu / HTTP/1.1 -7: %Invalid pattern
Any suggestions of how to mute all headers, effectively only sending the contents of "-X" or how to individually drop unwanted headers?
NB: I use curl for whois requests, because it allows me to use proxies. I intentionally left this part out of the above examples.