Add http-put, and make any return code between 200 and 299 success.

db4
Alex Chapman 2008-09-17 19:35:30 +10:00
parent ea1110c8ac
commit b65feec3bd
1 changed files with 7 additions and 1 deletions

View File

@ -141,7 +141,7 @@ PRIVATE>
do-redirect
] with-variable ;
: success? ( code -- ? ) 200 = ;
: success? ( code -- ? ) 200 299 between? ;
ERROR: download-failed response body ;
@ -183,3 +183,9 @@ M: download-failed error.
: http-post ( post-data url -- response data )
<post-request> http-request ;
: <put-request> ( data url -- request )
<post-request> "PUT" >>method ;
: http-put ( data url -- response data )
<put-request> http-request ;