library(http/http_client) library provides more
powerful access to reading HTTP resources, providing keep-alive
chunked transfer and conversion of the content, such as
breaking down multipart data, parsing HTML, etc. The library
announces itself as providing
close(default) a new connection is created for this request and closed after the request has completed. If
'Keep-Alive'the library checks for an open connection on the requested host and port and re-uses this connection. The connection is left open if the other party confirms the keep-alive and closed otherwise.
User-Agentfield of the HTTP header. Default is
Unit(From, To), where From is an integer and To is either an integer or the atom
end. HTTP 1.1 only supports Unit =
bytes. E.g., to ask for bytes 1000-1999, use the option
Remaining options are passed to http_read_data/3.
Name(Value)pairs to guide the translation of the data. The following options are supported:
Content-Typeas provided by the HTTP reply header. Intended as a work-around for badly configured servers.
to(Target) option is provided the library tries
the registered plug-in conversion filters. If none of these succeed it
tries the built-in content-type handlers or returns the content as an
atom. The builtin content filters are described below. The provided
plug-ins are described in the following sections.
Finally, if all else fails the content is returned as an atom.
library(html_write)described in section section 3.18.
xml(XMLTerm), using the provided MIME type.
application/x-www-form-urlencodedas produced by browsers issuing a POST request from an HTML form. ListOfParameter is a list of Name=Value or Name(Value) .
multipart/form-dataas produced by browsers issuing a POST request from an HTML form using
multipart/form-data. This is a somewhat simplified MIME
multipart/mixedencoding used by browser forms including file input fields. ListOfData is the same as for the List alternative described below. Below is an example from the SWI-Prolog Sesame interface. Repository, etc. are atoms providing the value, while the last argument provides a value from a file.
..., http_post([ protocol(http), host(Host), port(Port), path(ActionPath) ], form_data([ repository = Repository, dataFormat = DataFormat, baseURI = BaseURI, verifyData = Verify, data = file(File) ]), _Reply, ), ...,
multipart/mixedand packed using mime_pack/3. See mime_pack/3 for details on the argument format.
This plug-in library
breaks multipart documents that are recognised by the
Mime-Version: 1.0 in the
header into a list of Name = Value pairs. This
library deals with data from web-forms using the
encoding as well as the FIPA
This plug-in library
provides a bridge between the SGML/XML/HTML parser provided by
and the http client library. After loading this hook the following
mime-types are automatically handled by the SGML parser.
library(sgml)using W3C HTML 4.0 DTD, suppressing and ignoring all HTML syntax errors. Options is passed to load_structure/3.
xmlns(XML + namespaces). Options is passed to load_structure/3. In particular,
dialect(xml)may be used to suppress namespace handling.
sgml. Options is passed to load_structure/3.