@@ -7,7 +7,7 @@ our $DYNAMIC_FILE_UPLOAD ||= 0; # make it defined (don't know why)
7
7
8
8
use Exporter 5.57 ' import' ;
9
9
10
- our @EXPORT =qw( GET HEAD PUT POST) ;
10
+ our @EXPORT =qw( GET HEAD PUT PATCH POST) ;
11
11
our @EXPORT_OK = qw( $DYNAMIC_FILE_UPLOAD DELETE) ;
12
12
13
13
require HTTP::Request;
@@ -21,7 +21,7 @@ sub GET { _simple_req('GET', @_); }
21
21
sub HEAD { _simple_req(' HEAD' , @_ ); }
22
22
sub DELETE { _simple_req(' DELETE' , @_ ); }
23
23
24
- for my $type (qw( PUT POST) ) {
24
+ for my $type (qw( PUT PATCH POST) ) {
25
25
no strict ' refs' ;
26
26
*{ __PACKAGE__ . " ::" . $type } = sub {
27
27
return request_type_with_data($type , @_ );
@@ -346,8 +346,8 @@ following call
346
346
but is less cluttered. What is different is that a header named
347
347
C<Content > will initialize the content part of the request instead of
348
348
setting 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.
351
351
352
352
The get(...) method of C<LWP::UserAgent > exists as a shortcut for
353
353
$ua->request(GET ...).
@@ -375,6 +375,14 @@ there is no way to directly specify a header that is actually called
375
375
"Content". If you really need this you must update the request
376
376
returned in a separate statement.
377
377
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
+
378
386
=item DELETE $url
379
387
380
388
=item DELETE $url, Header => Value,...
0 commit comments