#lang racket (require net/url) (define (copy-url-to-file urlstr filepath) (call/input-url (string->url urlstr) get-pure-port (lambda (input-port) (call-with-output-file filepath (curry copy-port input-port))))) (copy-url-to-file "http://localhost/data" "/tmp/lol")