]> gitweb.factorcode.org Git - factor.git/commitdiff
Merge branch 'experimental' into couchdb
authorAlex Chapman <chapman.alex@gmail.com>
Wed, 17 Sep 2008 10:02:34 +0000 (20:02 +1000)
committerAlex Chapman <chapman.alex@gmail.com>
Wed, 17 Sep 2008 10:02:34 +0000 (20:02 +1000)
basis/http/client/client.factor

index 5e22f5144d15e6879416a369631e2bf72770f7c9..d684d5af9212eae2e9143f38ba7755a28584f697 100755 (executable)
@@ -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 ;