how to send a http patch request with Lwp::Useragent?
perl, salesforce
Solution
my $request = HTTP::Request->new(PATCH => $url);
... Add any necessary headers and body ...
my $response = $ua->request($request);
Problem
I am working against the salesforce rest api with lwp::useragent. I have to use the http patch request. For get and post requests we get use the following code: require LWP::UserAgent; ``` my $ua = LWP::UserAgent->new; $ua->timeout(10); $ua->env_proxy; my $get_response = $ua->get('http://search.cpan.org/',x=>'y'); my $post_response = $ua->post('http://search.cpan.org/',x=>'y'); ``` Unfortunately this does not work ``` my $patch_response = $ua->patch('http://search.cpan.org/',x=>'y'); ``` I don't find how to do it with this module. There is a workaround to this problem like explained here How do I send a request using the PATCH method for a Salesforce update? This works but this is not a nice solution. I saw that with python it is possible to make explicitly patch requests How do I make a PATCH request in Python? so i assume that there is also an option with perl.