Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

Morpheus (was: set-net question. No, TWO questions)

 [1/8] from: hallvard::ystad::helpinhand::com at: 30-Oct-2001 8:40


Morpheus thing looks like good news! But it kind of prevented any answers to my questions. I repost, in the hope that someone knows the answers. And the two have become three... Hallvard Ystad skrev (Monday 29.10.2001, kl. 15.15):
>Inside the 'open func in system/schemes/http/handler I find the following: > HTTP-Get-Header: make object! [
<<quoted lines omitted: 22>>
>Will not the "none" setting override the setting I did with set-net? And >if not, how do I override it with a 'none value?
And here's the third: should "generic" be a lit-word or a word in the set-net func? Either way seems to do no difference. How can I know rebol is actually using my proxy? ~H

 [2/8] from: petr:krenzelok:trz:cz at: 30-Oct-2001 8:57


Hallvard Ystad wrote:
> Morpheus thing looks like good news! But it kind of prevented any answers > to my questions. I repost, in the hope that someone knows the answers. And
<<quoted lines omitted: 14>>
> >complicated. I can do a post operation by simply reducing ['post > >"key=value"] in a read/custom.
you don't need to use reduce imo, it is a kind of a dialect IIRC. read/custom url [POST {blablabla}] should be enough, but it really doesn't probably matter ...
> How do I change the http-accept header in > >the same simple manner? > >
http-accept-header??
> > > >~H
<<quoted lines omitted: 13>>
> should "generic" be a lit-word or a word in the set-net func? Either way > seems to do no difference. How can I know rebol is actually using my proxy?
just use View desktop and it's visual configurator and press save button. Then you can look at your user.r file to see how rebol stores the value ... btw: I have it defined as word, not literal ... -pekr-

 [3/8] from: hallvard:ystad:helpinhand at: 30-Oct-2001 9:23


Petr Krenzelok skrev (Tuesday 30.10.2001, kl. 08.57):
> > >Inside the 'open func in system/schemes/http/handler I find the > following:
<<quoted lines omitted: 6>>
> > > <> 80) join #":" port/port-id] #] >http-accept-header??
I mean the Accept: "*/*" header, as seen above. Certain browsers cannot parse HTML, some need WML and some need cHTML. I can detect most of these needs from the "user-agent" header, but sometimes the accept-header is just as good. And I need to be able to specify (in rebol, with the accept -header) that I want WML from a site, so that it won't return HTML.
>you don't need to use reduce imo, it is a kind of a dialect IIRC. >read/custom >url [POST {blablabla}] should be enough, but it really doesn't probably >matter
Thanks. (That's just the kind of code you get when you change it a lot back and forth... )
>just use View desktop and it's visual configurator and press save button. >Then >you can look at your user.r file to see how rebol stores the value ... >btw: I >have it defined as word, not literal ...
Good idea. Why didn't I think of that? Anyway: rebol stores it as a word, not a lit-word. And so do I, from now on... Thanks again, ~H

 [4/8] from: brett:codeconscious at: 30-Oct-2001 23:02


Hi
>From reading the source of the http-handler I think the following should
work for you. But I haven't tested it and I'm hoping you have some way to check that it works. Change the */* to whatever you need. You should be able to change the user-agent in the same way. Let us know if it works out. read/custom http-url [ header [Accept: "*/*"] ] If you wanted to do a post as well you could try read/custom http-url [ header [Accept: "*/*"] post {post-data-blah-blah-blah} ] I hope it helps! Brett.

 [5/8] from: hallvard:ystad:helpinhand at: 30-Oct-2001 13:17


Brett Handley skrev (Tuesday 30.10.2001, kl. 13.02):
> read/custom http-url [ header [Accept: "*/*"] ]
print t: read/custom http://193.217.79.217/cgi-bin/test-cgi [header [Accept: "text/plain"]] print t: read/custom http://193.217.79.217/cgi-bin/test-cgi [header [http-Accept: "text/plain"]] print t: read/custom http://193.217.79.217/cgi-bin/test-cgi [header [http_Accept: "text/plain"]] Don't work. Sorry. They all return: HTTP_ACCEPT = text/html (which I set with cyphre's suggestion a m inute ago). ~H

 [6/8] from: brett:codeconscious at: 30-Oct-2001 23:33


Actually no. It does work. I just tried your address. Restart Rebol you may have corrupted the handler....
>> print t: read/custom http://193.217.79.217/cgi-bin/test-cgi [header
[Accept: "text/plain"]]
<snip>
HTTP_ACCEPT = text/plain
<snip>
Brett.

 [7/8] from: hallvard:ystad:helpinhand at: 30-Oct-2001 13:45


Brett Handley skrev (Tuesday 30.10.2001, kl. 13.33):
>Restart Rebol you may have corrupted the handler....
So I did. And:
>> print t: read/custom http://193.217.79.217/cgi-bin/test-cgi [header
[Accept: "text/plain"]] connecting to: 193.217.79.217 CGI/1.0 test script report: [...] HTTP_ACCEPT = */* [...] Hm... ~H

 [8/8] from: brett:codeconscious at: 31-Oct-2001 0:10


I found it. You did say you were using Core 2.5. I'm using View 1.2.1. The handler in View 1.2.1 is a later version and has been updated to accept the header keyword in the custom block. Core 2.5 didn't have that - it only had the post keyword. So I guess you need to install the View 1.2.1 http handler into Core 2.5 along the lines that Pekr suggested earlier, or insert your own sneaky difference patch with suitable version testing. Sorry I didn't catch on earlier. Now I'm off to bed! Brett.

Notes
  • Quoted lines have been omitted from some messages.
    View the message alone to see the lines that have been omitted