wrappers/pl_HTTP_Headers.cmx: perl.cmx
wrappers/pl_HTTP_Message.cmo: wrappers/pl_HTTP_Headers.cmo perl.cmi
wrappers/pl_HTTP_Message.cmx: wrappers/pl_HTTP_Headers.cmx perl.cmx
+wrappers/pl_HTTP_Request_Common.cmo: wrappers/pl_HTTP_Request.cmo perl.cmi
+wrappers/pl_HTTP_Request_Common.cmx: wrappers/pl_HTTP_Request.cmx perl.cmx
wrappers/pl_HTTP_Request.cmo: wrappers/pl_URI.cmo \
wrappers/pl_HTTP_Message.cmo perl.cmi
wrappers/pl_HTTP_Request.cmx: wrappers/pl_URI.cmx \
wrappers/pl_HTTP_Message.cmx perl.cmx
-wrappers/pl_HTTP_Request_Common.cmo: wrappers/pl_HTTP_Request.cmo perl.cmi
-wrappers/pl_HTTP_Request_Common.cmx: wrappers/pl_HTTP_Request.cmx perl.cmx
wrappers/pl_HTTP_Response.cmo: wrappers/pl_HTTP_Request.cmo \
wrappers/pl_HTTP_Message.cmo perl.cmi
wrappers/pl_HTTP_Response.cmx: wrappers/pl_HTTP_Request.cmx \
wrappers/pl_HTTP_Request.cmo wrappers/pl_HTTP_Cookies.cmo perl.cmi
wrappers/pl_LWP_UserAgent.cmx: wrappers/pl_HTTP_Response.cmx \
wrappers/pl_HTTP_Request.cmx wrappers/pl_HTTP_Cookies.cmx perl.cmx
+wrappers/pl_Net_Google_Cache.cmo: perl.cmi
+wrappers/pl_Net_Google_Cache.cmx: perl.cmx
wrappers/pl_Net_Google.cmo: wrappers/pl_Net_Google_Spelling.cmo \
wrappers/pl_Net_Google_Search.cmo wrappers/pl_Net_Google_Cache.cmo \
perl.cmi
wrappers/pl_Net_Google.cmx: wrappers/pl_Net_Google_Spelling.cmx \
wrappers/pl_Net_Google_Search.cmx wrappers/pl_Net_Google_Cache.cmx \
perl.cmx
-wrappers/pl_Net_Google_Cache.cmo: perl.cmi
-wrappers/pl_Net_Google_Cache.cmx: perl.cmx
wrappers/pl_Net_Google_Response.cmo: perl.cmi
wrappers/pl_Net_Google_Response.cmx: perl.cmx
wrappers/pl_Net_Google_Search.cmo: wrappers/pl_Net_Google_Response.cmo \
*
* Copyright (C) 2004 Merjis Ltd.
*
- * $Id: pl_WWW_Mechanize.ml,v 1.5 2005-05-19 11:10:18 rich Exp $
+ * $Id: pl_WWW_Mechanize.ml,v 1.6 2005-08-16 15:39:22 rich Exp $
*)
open Perl
method submit () =
call_method_void sv "submit" []
- (*method submit_form ?form_number ?form_name ?fields ?button ?xy () *)
+ 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
method success =
let sv = call_method sv "success" [] in