HTTP conectivity
Author(s): Daniel Cabeza.
This module implements the HTTP protocol, which allows retrieving data from HTTP servers.
Usage and interface
- Library usage:
:- use_module(library(http)). - Exports:
- Predicates:
fetch_url/3.
- Predicates:
- Imports:
- System library modules:
strings, lists, pillow/pillow_aux, pillow/pillow_types, pillow/http_ll. - Packages:
prelude, nonpure, assertions, isomodes, dcg.
- System library modules:
Documentation on exports
PREDICATE
fetch_url(URL,Request,Response)
Fetches the document pointed to by URL from Internet, using request parameters Request, and unifies Response with the parameters of the response. Fails on timeout. Note that redirections are not handled automatically, that is, if Response contains terms of the form status(redirection,301,_) and location(NewURL), the program should in most cases access location NewURL.
(True) Usage:fetch_url(URL,Request,Response)
- The following properties should hold at call time:
(pillow_types:url_term/1)URL specifies a URL.
(basic_props:list/2)Request is a list of http_request_params. - The following properties hold upon exit:
(basic_props:list/2)Response is a list of http_response_params.