Most code doesn't need to use this directly; instead use library(http/http_server), which combines this library with the typical HTTP libraries that most servers need.
This module is used to extract the value of GET or POST parameters from an HTTP request. The typical usage is e.g.,
:- http_handler('/register_user', register_user, []). register_user(Request) :- http_parameters(Request, [ name(Name, []), sex(Sex, [oneof([male,female])]), birth_year(BY, [between(1850,10000)]) ]), register_user(Name, Sex, BY), html_reply_page(title('New user added'), ...).
call(Goal, A, Declarations)
.The attribute_declarations hook allows sharing the declaration of attribute-properties between many http_parameters/3 calls. In this form, the requested attribute takes only one argument and the options are acquired by calling the hook. For example:
..., http_parameters(Request, [ sex(Sex) ], [ attribute_declarations(http_param) ]), ... http_param(sex, [ oneof(male, female), description('Sex of the person') ]).
http_parameters(Request, Params) :- http_read_data(Request, Data, []), http_convert_parameters(Data, Params).
The following predicates are exported, but not or incorrectly documented.