> hi there everyone. is there a way to adjust the headers sent 
> by cfhttp? i'm trying to establish a connection to an 
> application, and it requires very specific headers.

You can use the CFHTTPPARAM tag to send headers. Here's an example which
sends the Referer header (which you'd reference within the target page using
CGI.HTTP_REFERER, if you're using CF within the target page):

<cfhttp ... method="post">
        <cfhttpparam type="CGI" name="Referer"
value="http://www.somewhere.com/somepage.html";>
</cfhttp>

Unfortunately, to use CFHTTPPARAM, you have to use METHOD="POST" in your
CFHTTP tag. At least, I'm pretty sure about that - it's been a while since
I've bothered to use CFHTTP for various reasons. I seem to recall that, as a
workaround, you could do something like this:

<cfhttp ... method="get"
        useragent="... some useragent string
Referer: http://www.somewhere.com/somepage.html
Host: www.somewhere.com
FooHeader: FooValue">
</cfhttp>

In the above example, the additional headers are simply put within the
USERAGENT attribute, separated by carriage returns. Again, though, it's been
a while since I've bothered to use CFHTTP, so I don't know how well that
works generally. If I recall correctly, the above example will work in CF 5,
but not in CFMX. I could be wrong about that, though.

If CFHTTP doesn't do what you need, you might investigate some of the
available third-party options for sending HTTP requests.

Dave Watts, CTO, Fig Leaf Software
http://www.figleaf.com/
voice: (202) 797-5496
fax: (202) 797-5444

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: 
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq

Get the mailserver that powers this list at 
http://www.coolfusion.com

                                Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
                                

Reply via email to