[REBOL] Re: Setting http referer field question
From: g:santilli:tiscalinet:it at: 1-Feb-2001 12:12
[bo--rebol--com] wrote:
> Hack the http:// protocol to add a way to specify the referrer when
> submitting an HTTP open request.
system/schemes/http/handler/open contains:
HTTP-Get-Header: make object! [
Accept: "*/*"
Connection: "close"
User-Agent: system/schemes/http/user-agent
Host: join port/host any [all [port/port-id (port/port-id
<> 80) join #":" port/port-id] #]
]
You could hack it this way:
>> code: second get in system/schemes/http/handler 'open
== [
port/locals: make object! [list: copy [] headers: none]
build-port: func [] [
open-proto port
port/u...
>> code: find code first [Http-Get-Header:]
== [
HTTP-Get-Header: make object! [
Accept: "*/*"
Connection: "close"
User-Agent: system/schemes/htt...
>> code: code/4
== [
Accept: "*/*"
Connection: "close"
User-Agent: system/schemes/http/user-agent
Host: join port/host any [all ...
>> insert tail code [Referer: My-Http-Referer]
== [
]
Then you can set it simply with:
>> my-http-referer: "something"
== "something"
> I am adding this as an enhancement to our database.
Exporting that object out of that function would do the job. Then
we could simply access, say,
system/schemes/http/handler/http-get-header.
HTH,
Gabriele.
--
Gabriele Santilli <[giesse--writeme--com]> - Amigan - REBOL programmer
Amiga Group Italia sez. L'Aquila -- http://www.amyresource.it/AGI/