Fix use of CAMLparam etc macros.
[perl4caml.git] / wrappers / pl_LWP_UserAgent.ml
index 941ba36..da9d4c0 100644 (file)
@@ -1,8 +1,22 @@
-(** Wrapper around Perl [LWP::UserAgent] class.
-  *
-  * Copyright (C) 2003 Merjis Ltd.
-  *
-  * $Id: pl_LWP_UserAgent.ml,v 1.4 2004-11-22 17:08:36 rich Exp $
+(** Wrapper around Perl [LWP::UserAgent] class. *)
+(*  Copyright (C) 2003 Merjis Ltd.
+
+    This library is free software; you can redistribute it and/or
+    modify it under the terms of the GNU Library General Public
+    License as published by the Free Software Foundation; either
+    version 2 of the License, or (at your option) any later version.
+
+    This library is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+    Library General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with this library; see the file COPYING.  If not, write to
+    the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+    Boston, MA 02111-1307, USA.
+
+    $Id: pl_LWP_UserAgent.ml,v 1.6 2008-03-01 13:02:21 rich Exp $
   *)
 
 open Perl
@@ -40,6 +54,18 @@ object (self)
     let hv = hv_empty () in
     hv_set hv "file" (sv_of_string filename);
     call_method_void sv "cookie_jar" [hashref hv]
+  method requests_redirectable =
+    let sv = call_method sv "requests_redirectable" [] in
+    let av = deref_array sv in
+    List.map string_of_sv (list_of_av av)
+  method set_requests_redirectable methods =
+    let av = av_empty () in
+    List.iter (av_push av) (List.map sv_of_string methods);
+    call_method_void sv "requests_redirectable" [arrayref av]
+  method add_requests_redirectable method_ =
+    let sv = call_method sv "requests_redirectable" [] in
+    let av = deref_array sv in
+    av_push av (sv_of_string method_)
   method timeout =
     int_of_sv (call_method sv "timeout" [])
   method set_timeout v =
@@ -52,7 +78,7 @@ object (self)
     int_of_sv (call_method sv "max_size" [])
   method set_max_size v =
     call_method_void sv "max_size" [sv_of_int v]
-  method env_proxy =
+  method env_proxy () =
     call_method_void sv "env_proxy" []
 
 end