HTTP client

Author(s): Daniel Cabeza, Jose F. Morales (fixes, improvements).

This module implements a client the HTTP protocol.

Usage and interface

  • Library usage:
    :- use_module(library(http/http_client)).
  • Exports:

Documentation on exports

PREDICATEfetch_url/3
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.

Usage:fetch_url(URL,Request,Response)

  • The following properties should hold at call time:
    (url:url_term/1)URL specifies a URL.
    (basic_props:list/2)Request is a list of http_request_params.
  • The following properties should hold upon exit:
    (basic_props:list/2)Response is a list of http_response_params.

(UNDOC_REEXPORT)http_request_param/1
Imported from http_messages (see the corresponding documentation for details).

(UNDOC_REEXPORT)http_request_param/1
Imported from http_messages (see the corresponding documentation for details).

(UNDOC_REEXPORT)http_response_param/1
Imported from http_messages (see the corresponding documentation for details).

(UNDOC_REEXPORT)http_response_param/1
Imported from http_messages (see the corresponding documentation for details).

Documentation on imports

This module has the following direct dependencies: