1 (** Wrapper around Perl [HTTP::Request] class.
3 * Copyright (C) 2003 Merjis Ltd.
5 * $Id: pl_HTTP_Request.ml,v 1.4 2005-01-13 16:06:04 rich Exp $
13 let _ = eval "use HTTP::Request"
15 class http_request sv =
18 inherit http_message sv
23 string_of_sv (call_method sv "method" [])
24 method set_method meth =
25 call_method_void sv "method" [sv_of_string meth]
27 string_of_sv (call_method sv "uri" [])
29 call_method_void sv "uri" [sv_of_string uri]
31 string_of_sv (call_method sv "as_string" [])
35 let new_ meth ?uri_obj ?uri (* ?header ?content *) () =
37 match uri_obj, uri with
39 failwith ("Pl_HTTP_Request.new_ must be called with either a "^
40 "~uri_obj (URI object) or ~uri (string) parameter.")
41 | Some (uri_obj : uri), None ->
42 call_class_method "HTTP::Request" "new" [sv_of_string meth;
45 call_class_method "HTTP::Request" "new" [sv_of_string meth;