summaryrefslogtreecommitdiff
path: root/doc/ref
diff options
context:
space:
mode:
authorArun Isaac <arunisaac@systemreboot.net>2018-06-21 22:57:18 +0530
committerAndy Wingo <wingo@pobox.com>2018-08-07 12:13:19 +0200
commite40b5b54ff996e098ca16a8125c0e325b7de8558 (patch)
treefe5cfd77bccba7a9157bb2878516bebf01f419ed /doc/ref
parent25c719b41294176677f82c511e8e1ca50793b18c (diff)
downloadguile-e40b5b54ff996e098ca16a8125c0e325b7de8558.tar.gz
web: Export http-request.
* module/web/client.scm (request): Rename to http-request, add a docstring, and export it. (http-get, http-head, http-post, http-put, http-delete, http-trace, http-options): Update docstring. * doc/ref/web.texi (Web Client): Document http-request. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
Diffstat (limited to 'doc/ref')
-rw-r--r--doc/ref/web.texi41
1 files changed, 27 insertions, 14 deletions
diff --git a/doc/ref/web.texi b/doc/ref/web.texi
index 07da5b64b..c8fc488b7 100644
--- a/doc/ref/web.texi
+++ b/doc/ref/web.texi
@@ -1,6 +1,6 @@
@c -*-texinfo-*-
@c This is part of the GNU Guile Reference Manual.
-@c Copyright (C) 2010, 2011, 2012, 2013, 2015 Free Software Foundation, Inc.
+@c Copyright (C) 2010, 2011, 2012, 2013, 2015, 2018 Free Software Foundation, Inc.
@c See the file guile.texi for copying conditions.
@node Web
@@ -1463,24 +1463,18 @@ how to install the GnuTLS bindings for Guile,, gnutls-guile,
GnuTLS-Guile}, for more information.
@end deffn
-@deffn {Scheme Procedure} http-get uri arg...
-@deffnx {Scheme Procedure} http-head uri arg...
-@deffnx {Scheme Procedure} http-post uri arg...
-@deffnx {Scheme Procedure} http-put uri arg...
-@deffnx {Scheme Procedure} http-delete uri arg...
-@deffnx {Scheme Procedure} http-trace uri arg...
-@deffnx {Scheme Procedure} http-options uri arg...
+@anchor{http-request}@deffn {Scheme Procedure} http-request @var{uri} @var{arg}@dots{}
Connect to the server corresponding to @var{uri} and make a request over
-HTTP, using the appropriate method (@code{GET}, @code{HEAD}, etc.).
+HTTP, using @var{method} (@code{GET}, @code{HEAD}, @code{POST}, etc.).
-All of these procedures have the same prototype: a URI followed by an
-optional sequence of keyword arguments. These keyword arguments allow
-you to modify the requests in various ways, for example attaching a body
-to the request, or setting specific headers. The following table lists
-the keyword arguments and their default values.
+The following keyword arguments allow you to modify the requests in
+various ways, for example attaching a body to the request, or setting
+specific headers. The following table lists the keyword arguments and
+their default values.
@table @code
+@item #:method 'GET
@item #:body #f
@item #:port (open-socket-for-uri @var{uri})]
@item #:version '(1 . 1)
@@ -1518,6 +1512,25 @@ body as a string, bytevector, #f value, or as a port (if
@var{streaming?} is true).
@end deffn
+@deffn {Scheme Procedure} http-get @var{uri} @var{arg}@dots{}
+@deffnx {Scheme Procedure} http-head @var{uri} @var{arg}@dots{}
+@deffnx {Scheme Procedure} http-post @var{uri} @var{arg}@dots{}
+@deffnx {Scheme Procedure} http-put @var{uri} @var{arg}@dots{}
+@deffnx {Scheme Procedure} http-delete @var{uri} @var{arg}@dots{}
+@deffnx {Scheme Procedure} http-trace @var{uri} @var{arg}@dots{}
+@deffnx {Scheme Procedure} http-options @var{uri} @var{arg}@dots{}
+Connect to the server corresponding to @var{uri} and make a request over
+HTTP, using the appropriate method (@code{GET}, @code{HEAD},
+@code{POST}, etc.).
+
+These procedures are variants of @code{http-request} specialized with a
+specific @var{method} argument, and have the same prototype: a URI
+followed by an optional sequence of keyword arguments.
+@xref{http-request}, for full documentation on the various keyword
+arguments.
+
+@end deffn
+
@code{http-get} is useful for making one-off requests to web sites. If
you are writing a web spider or some other client that needs to handle a
number of requests in parallel, it's better to build an event-driven URL