version 1.1, 2010/09/24 17:01:00
|
version 1.3, 2010/12/31 18:09:02
|
Line 1
|
Line 1
|
\ a http get command |
\ a http get command |
|
|
\ Copyright (C) 2000,2002,2003,2006,2007 Free Software Foundation, Inc. |
\ Copyright (C) 2000,2002,2003,2006,2007,2010 Free Software Foundation, Inc. |
|
|
\ This file is part of Gforth. |
\ This file is part of Gforth. |
|
|
Line 138 Variable data-buffer
|
Line 138 Variable data-buffer
|
Content-Length @ IF |
Content-Length @ IF |
Content-Length $@ s>number drop r> read-sized EXIT THEN |
Content-Length $@ s>number drop r> read-sized EXIT THEN |
Transfer-Encoding @ IF |
Transfer-Encoding @ IF |
Transfer-Encoding $@ s" chunked" str= 0= IF |
Transfer-Encoding $@ s" chunked" str= IF |
r> read-chunked EXIT THEN THEN |
r> read-chunked EXIT THEN THEN |
r> read-to-end ; |
r> read-to-end ; |
|
|
: fslurp ( addr u -- addr u ) |
: fslurp ( addr u -- addr u response ) |
'/ $split -1 /string |
'/' $split -1 /string |
http-open dup >r get-response throw r> read-data data-buffer $@ ; |
http-open dup >r get-response throw r> read-data data-buffer $@ |
|
response-string $@ bl $split 2drop s>number drop ; |
|
|
|
\ download file |