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

HTTP Status codes?

 [1/5] from: Karl::Lewin::BNSF::com at: 22-Sep-2003 17:01


Is it possible to get at these via either read http:// or open http:// ? I'm trying to see whether a "" response is really a HTTP 304 response. Thanks- Karl

 [2/5] from: brett:codeconscious at: 24-Sep-2003 10:34


Well it looks like the global word Response-Code gets set.
>> read http://www.rebol.com
connecting to: www.rebol.com == {<HTML> <HEAD> <META HTTP-EQUIV="Content-Type" CONTENT="text/html;CHARSET=iso-8859-1"> <META NAME="KEYWORDS" CONTENT="REBOL, reb...
>> response-code
== 200 I doubt that response-code should be a global word. It probably should be a field of the port or something. So don't be suprised if this changes in future. Regards, Brett. Note to self: Feedback sent (Id #39nj33360)

 [3/5] from: rotenca:telvia:it at: 24-Sep-2003 13:42


Hi Brett, It is one of many words that the http handler forgets to make local, the buggy function is open, it has many locals: /local http-packet http-command response-actions success error response-line target headers http-version post-data result generic-proxy? sub-protocol build-port send-and-check create-request but they are not enough ;-) It changes the value of these global words: line HTTP-Get-Header continue-post HTTP-Header tunnel-actions response-code tunnel-success forward proxyauth Try: query/clear system/words open http://www.rebol.com query/clear system/words open http://www.rebol.com probe query/clear system/words open must be done twice, to see only the words that are changed. Could be a wanted result for some words? I do not think it. (submitted to feedback) --- Ciao Romano

 [4/5] from: brett:codeconscious at: 24-Sep-2003 21:49


> It is one of many words that the http handler forgets to make local, the
buggy
> function is open, it has many locals:
...
> It changes the value of these global words:
Wow. Thanks Romano. Regards, Brett.

 [5/5] from: antonr:iinet:au at: 25-Sep-2003 2:52


Yeah, wow, that's quite amazing. Prompts me to propose a new mezzanine like this: word-diff: func [code][ query/clear system/words do code query/clear system/words ] Similar in concept to attempt. Usage: code: [read http://www.rebol.com] word-diff code probe words: word-diff code ;== [line HTTP-Get-Header continue-post HTTP-Header tunnel-actions ; response-code tunnel-success forward proxyauth] Could be useful built-in. It seems an important debugging tool, why not make it easy to use? Anton.