Permalink
Browse files

now with put and delete helpers

  • Loading branch information...
1 parent a0f8029 commit f6147731bbc1267d13b6815c33226d76870b3c35 @trcjr committed Mar 26, 2011
Showing with 16 additions and 0 deletions.
  1. +16 −0 lib/LWP/UserAgent.pm
View
@@ -429,6 +429,22 @@ sub head {
}
+sub put {
+ require HTTP::Request::Common;
+ my($self, @parameters) = @_;
+ my @suff = $self->_process_colonic_headers(\@parameters, (ref($parameters[1]) ? 2 : 1));
+ return $self->request( HTTP::Request::Common::PUT( @parameters ), @suff );
+}
+
+
+sub delete {
+ require HTTP::Request::Common;
+ my($self, @parameters) = @_;
+ my @suff = $self->_process_colonic_headers(\@parameters,1);
+ return $self->request( HTTP::Request::Common::DELETE( @parameters ), @suff );
+}
+
+
sub _process_colonic_headers {
# Process :content_cb / :content_file / :read_size_hint headers.
my($self, $args, $start_index) = @_;

0 comments on commit f614773

Please sign in to comment.