curl-users
Re: Removing headers
Date: Fri, 28 Jul 2000 09:13:55 +0200 (MET DST)
On Thu, 27 Jul 2000, Jeff Schasny wrote:
> I'm trying to use curl to communicate with credit card processing company
> and they are VERY unusual about the way they want to see the HTTP
> headers. Essentialy they want a single "Content-Type" and
> "Content-Length" and nothing else. No mime boundrys or other headers are
> allowed.
I'm guessing here that you're talking about POST operations? Isn't that rule
"No mime boundrys or other headers" just suggesting that you should use the
"-d style" post instead of the -F?
rfc1867-style posting is hardly possible without those separator headers.
Also, the "Host:" header is *REQUIRED* by HTTP/1.1, are you absolutely sure
that isn't supposed to be there?
> Any clues, thoughts, direction or outright laughter on where to begin
> hacking out sections of source code would be appreciated.
Once we've settled which operation you should do, I think you should be able
to disable most headers entirely without modifying source code! Hm, no, in
fact you can make curl send empty headers modifying source code. that might
not do it for you then if that server is as picky as you say...
To disable headers, just replace them with your own empty ones:
curl -H "User-Agent:" -H "Host:" www.thatweirdhost.com
To remove internally generated headers completely from the HTTP request, jump
to line 307 in lib/http.c and edit the sendf() line.
If you end up writing something nice that removes headers from a request on
demand, I'll be interested in a patch...!
-- Daniel Stenberg - http://daniel.haxx.se - +46-705-44 31 77 ech`echo xiun|tr nu oc|sed 'sx\([sx]\)\([xoi]\)xo un\2\1 is xg'`olReceived on 2000-07-28