[REBOL] Re: HTTP-Post Error
From: mattymattkim::hotmail at: 19-Oct-2002 8:41
To be quite honest, I'm still a newbie at REBOL and I find the code you
posted, very difficult to understand! I wish I were a REBOL genious! =)
>From: RebOldes <[rebol-list2--seznam--cz]>
>Reply-To: [rebol-list--rebol--com]
>To: Graham Chiu <[rebol-list--rebol--com]>
>Subject: [REBOL] Re: HTTP-Post Error
>Date: Sat, 19 Oct 2002 10:10:06 +0200
>
>Hello Graham,
>
>Thursday, October 17, 2002, 9:25:00 AM, you wrote:
>
> >>It's been working beautifully in the past with some help
> >>from you REBOL genious' but now occasionally I seem to
> >>get a "HTTP/1.1 500 Internal Server Error".
> >>
> >>http://216.129.53.44:8080/cgi-bin/send_sm_rogers.new?
>
>GC> Perhaps the server code is dying because of the extra "?"
>GC> you've added here. The "?" is used when using the GET
>GC> method, but not with POST.
>
>GC> Also, have you tried using 'read as in
>
>GC> read/custom
>GC> http://216.129.53.44:8080/cgi-bin/send_sm_rogers.new [ ...
>GC> ]
>
>GC> to POST your message?
>
>GC> --
>GC> Graham Chiu
>
>Yes, the read/custom and open/custom is very useful, some pages needs to be
>accesed
>only from some pages so the 'Referer and 'Host in the header must be set
>correctly, I'm using for example this code (and will have to add this
>to my %reb-web-bot.r script as well):
>
>This is not complete code, because first I want to make some code
>cleaning before puclicating it:-) only important parts are here now:
>
>port: open/direct/binary/custom
>http://www2.eurotel.cz/sms/index.html?n_pagestyle=new2 [
> header [
> User-Agent: "Mozilla/4.0 (compatible; MSIE 6.0; Windows
>98)"
> Referer:
>"http://www2.eurotel.cz/sms/index.html?n_pagestyle=new2"
> Host: "www2.eurotel.cz"
> ]
>]
>probe port/locals
>cookie: port/locals/headers/set-cookie
>buffer: make binary! 8000
>set-modes port/sub-port [lines: false binary: true no-wait: true]
>until [
> if not data: wait [60 port/sub-port] [data: true break]
> if data: copy port/sub-port [append buffer data]
> not data
>]
>close port
>
> ;some page parsing is here.....
> ;...after the parsing I have: poststr with the url-encoded postdata
> ;so I can send them:
>
>print read/custom rejoin [http:// port/host %/sms/index.html] x:
>compose/deep [
> header [
> User-Agent: "Mozilla/4.0 (compatible; MSIE 6.0; Windows
>98)"
> Referer:
>"http://www2.eurotel.cz/sms/index.html?n_pagestyle=new2"
> Host: "www2.eurotel.cz"
> Cookie: (cookie)
> ]
> post (poststr)
>]
>
>buffer: make binary! 8000
> set-modes port/sub-port [lines: false binary: true no-wait:
>true]
> until [
> if not data: wait [60 port/sub-port] [data: true break]
> if data: copy port/sub-port [append buffer data]
> not data
> ]
>close port
>print buffer: to-string buffer
>
>--
> >>do [send to-email join 'oliva [--david--seznam--cz] "BESsssT REgArrrDssss,
>RebOldes"]
>
>--
>To unsubscribe from this list, please send an email to
>[rebol-request--rebol--com] with "unsubscribe" in the
>subject, without the quotes.
Matt Kim
If everything is under control, you are going too slow
-Mario Andretti
_________________________________________________________________
Protect your PC - get McAfee.com VirusScan Online