1:- module(bc_form, [
    2    bc_form_read/1
    3]).

Module for reading form inputs from the current request */

    7:- use_module(library(http/http_wrapper)).    8:- use_module(library(http/http_client)).
 bc_form_read(-Dict) is semidet
Reads application/x-www-form-urlencoded data using http_read_data/3 and turns it into a dict. Fails when http_read_data/3 retrieves data not as a list.
   17bc_form_read(Dict):-
   18    http_current_request(Request),
   19    http_read_data(Request, Data, []),
   20    (   is_list(Data)
   21    ->  dict_create(Dict, _, Data)
   22    ;   fail)