         [ do-redirect ] [ nip ] if
     ] with-variable ; inline recursive
 
-PRIVATE>
-
 : success? ( code -- ? ) 200 299 between? ;
 
 ERROR: download-failed response data ;

    drop
    [ "Redirection limit of " % max-redirects # " exceeded" % ] "" make ;

<PRIVATE

DEFER: with-http-request

SYMBOL: redirects


: <request-socket> ( -- stream )
    request get url>> url-addr ascii <client> drop
    1 minutes over set-timeout ;

PRIVATE>

: with-http-request ( request quot: ( chunk -- ) -- response )
    swap
