@@ -7,7 +7,7 @@ our $DYNAMIC_FILE_UPLOAD ||= 0; # make it defined (don't know why)
77
88use Exporter 5.57 ' import' ;
99
10- our @EXPORT =qw( GET HEAD PUT POST) ;
10+ our @EXPORT =qw( GET HEAD PUT PATCH POST) ;
1111our @EXPORT_OK = qw( $DYNAMIC_FILE_UPLOAD DELETE) ;
1212
1313require HTTP::Request;
@@ -21,7 +21,7 @@ sub GET { _simple_req('GET', @_); }
2121sub HEAD { _simple_req(' HEAD' , @_ ); }
2222sub DELETE { _simple_req(' DELETE' , @_ ); }
2323
24- for my $type (qw( PUT POST) ) {
24+ for my $type (qw( PUT PATCH POST) ) {
2525 no strict ' refs' ;
2626 *{ __PACKAGE__ . " ::" . $type } = sub {
2727 return request_type_with_data($type , @_ );
@@ -346,8 +346,8 @@ following call
346346but is less cluttered. What is different is that a header named
347347C<Content > will initialize the content part of the request instead of
348348setting a header field. Note that GET requests should normally not
349- have a content, so this hack makes more sense for the PUT() and POST ()
350- functions described below.
349+ have a content, so this hack makes more sense for the PUT(), PATCH ()
350+ and POST() functions described below.
351351
352352The get(...) method of C<LWP::UserAgent > exists as a shortcut for
353353$ua->request(GET ...).
@@ -375,6 +375,14 @@ there is no way to directly specify a header that is actually called
375375"Content". If you really need this you must update the request
376376returned in a separate statement.
377377
378+ =item PATCH $url
379+
380+ =item PATCH $url, Header => Value,...
381+
382+ =item PATCH $url, Header => Value,..., Content => $content
383+
384+ Like PUT() but the method in the request is "PATCH".
385+
378386=item DELETE $url
379387
380388=item DELETE $url, Header => Value,...
0 commit comments