]> gitweb.factorcode.org Git - factor.git/commitdiff
Merge branch 'master' into experimental
authorAlex Chapman <chapman.alex@gmail.com>
Mon, 16 Feb 2009 01:48:58 +0000 (12:48 +1100)
committerAlex Chapman <chapman.alex@gmail.com>
Mon, 16 Feb 2009 01:48:58 +0000 (12:48 +1100)
Conflicts:
basis/http/client/client.factor

1  2 
basis/http/client/client.factor

index 113e8ec3acba5e62b0f30f0efa294d12222729db,4099e3d84cc35fea26d929db7ed75a060d13c1b2..1ba32cc61da9e6271f28e82c5ec8df93ee76762c
@@@ -138,17 -136,16 +138,20 @@@ PRIVATE
  
  : success? ( code -- ? ) 200 299 between? ;
  
 -ERROR: download-failed response ;
 +ERROR: download-failed response data ;
  
 -: check-response ( response -- response )
 -    dup code>> success? [ download-failed ] unless ;
 +M: download-failed error.
 +    "HTTP request failed:" print nl
 +    [ response>> . ] [ data>> . ] bi ;
 +
 +: check-response* ( response data -- response data )
 +    over code>> success? [ download-failed ] unless ;
  
+ : check-response-with-body ( response body -- response body )
+     [ >>body check-response ] keep ;
  : with-http-request ( request quot -- response )
-     [ (with-http-request) check-response ] with-destructors ; inline
+     [ (with-http-request) ] with-destructors ; inline
  
  : http-request ( request -- response data )
      [ [ % ] with-http-request ] B{ } make