method submit_form ?form_number ?form_name ?fields ?button ?xy () =
let args = ref [] in
let add name f = function
| None -> ()
| Some p -> args := sv_of_string name :: f p :: !args
in
add "form_number" sv_of_int form_number;
add "form_name" sv_of_string form_name;
(match fields with
| None -> ()
| Some fields ->
let hv = hv_empty () in
List.iter (
fun (name, value) ->
hv_set hv name (sv_of_string value)
) fields;
let sv = hashref hv in
args := sv_of_string "fields" :: sv :: !args
);
add "button" sv_of_string button;
(match xy with
| None -> ()
| Some (x, y) ->
args := sv_of_string "x" :: sv_of_int x ::
sv_of_string "y" :: sv_of_int y :: !args);
let sv = call_method sv "submit_form" !args in
new Pl_HTTP_Response.http_response sv