Add http-post, http-put, et cetera
authorAndy Wingo <wingo@pobox.com>
Fri, 11 Jan 2013 10:15:28 +0000 (11:15 +0100)
committerAndy Wingo <wingo@pobox.com>
Fri, 11 Jan 2013 14:40:00 +0000 (15:40 +0100)
commit990b11c53f8da2a6c14e1190bc4e76939db32d07
tree408f1a4688063dd67c1fc29fa60ad43b6a2fa2b3
parent2ac3c0a590ec93f40b2c1ce34bd24b83f1ae1a5d
Add http-post, http-put, et cetera

* module/web/client.scm (ensure-uri): New helper.
  (open-socket-for-uri): Accept a URI as a string or as a URI object.
  (extend-request, sanitize-request): New helpers, like the
  corresponding functions in (web server).
  (decode-response-body): Add a reference to the HTTP/1.1 spec, and
  use (ice-9 iconv).
  (request): New helper, factoring all aspects of sending an HTTP
  request and getting a response.
  (http-get): Redefine in terms of http-get.  Deprecate the
  #:extra-headers argument in favor of #:headers.  Allow a body.  Add a
  #:streaming? argument, subsuming the functionality of http-get*.
  (http-get*): Deprecate.
  (http-head, http-post, http-put, http-delete, http-trace)
  (http-options): Define interfaces for all HTTP verbs.

* test-suite/tests/web-client.test: Add tests.

* doc/ref/web.texi: Update documentation.

Thanks to Gregory Benison for the initial patch.
doc/ref/web.texi
module/web/client.scm
test-suite/tests/web-client.test [new file with mode: 0644]