summaryrefslogtreecommitdiff
path: root/doc/ref/web.texi
diff options
context:
space:
mode:
Diffstat (limited to 'doc/ref/web.texi')
-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