Version: 4.1.5

HTTP 1.1 Client

A HTTP/1.1 streaming pipelining client. If you examine its inner workings you might note it simpler to just install squid and use net/url. Nevertheless!

Currently a persistent error in this code somewhere. It downloads everything perfectly, but occasionally randomly loses the middle part of the file. Some rare edge case no doubt. Oddly this only happens when you’re downloading many things at once from independant connections. Heavy frequent downloading seems to make it worse.

(require (prefix-in http: (planet synx/http))) (require srfi/19) (let-values ([(code headers input) (http:get (string->url "http://some.where/something"))]) (display (port->string input)) (display "\n")) (let-values ([(type modified) (download (string->url "http://some.where/something.jpg") (build-path "something.jpg"))]) (file-or-directory-modify-seconds (build-path "something.jpg") (time-second (date->time-utc modified))))