[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Downloading a file from a URL from the web with http-get
From: |
白熊 |
Subject: |
Re: Downloading a file from a URL from the web with http-get |
Date: |
Fri, 15 Aug 2014 19:59:42 +0200 |
User-agent: |
K-9 Mail for Android |
On 2014年8月4日 18:57:57 CEST, Dmitry Bogatov <address@hidden> wrote:
>So here is example for other url:
>
> (use-modules ((web uri) #:select (string->uri))
> ((web client) #:select (http-get)))
> (use-modules (rnrs io ports))
>
> (define *url*
> "http://hackage.haskell.org/package/HaTeX-2.1.3/HaTeX-2.1.3.tar.gz")
>
> (call-with-values
> (lambda () (http-get (string->uri *url*)))
> (lambda (res-headers res-body)
> (with-output-to-file "some.tar.gz"
> (lambda () (put-bytevector (current-output-port) res-body))
> #:binary #t)))
Is there a way to use similar syntax to download ftp files?
I can successfully download only http:// files this way.
--
白熊