title: Java 11 HttpRequest with PATCH method
body: <p>I try to use the java 11 <code>HttpRequest</code> to call the msgraph webservice using the method PATCH:</p>
  
  <pre><code>import java.net.http.HttpClient;
  import java.net.http.HttpRequest;
  import java.net.http.HttpResponse;
  import java.net.URI;
  import java.net.URLEncoder;
  
  import java.nio.charset.StandardCharsets;
  
  import groovy.json.JsonSlurper;
  import groovy.json.JsonOutput;
  
  access_token = "my_token";
  
  def url = 'https://graph.microsoft.com/v1.0/groups/group_id/drive/items/01P4AIIJ5QTIIAZ2FLEZBIZWRV6KEBIMM5/workbook/worksheets/%7B00000000-0001-0000-0000-000000000000%7D/range(address=\'A1\')'
  
  HttpClient httpClient = HttpClient.newBuilder()
                                      .version(HttpClient.Version.HTTP_2)
                                      .build();
  
  jsonPayloadString = '{"values":["blabla"]}';
  
  
  jsonPayload = HttpRequest.BodyPublishers.ofString(jsonPayloadString.toString())
  
  HttpRequest request = HttpRequest.newBuilder()
                                   .uri(URI.create(url))
                                   .PATCH(jsonPayload)
                                   .header("Content-Type", "application/json")
                                   .build();
  
  HttpResponse response = httpClient.send(request,HttpResponse.BodyHandlers.ofString());
  
  </code></pre>
  
  <p>The error : </p>
  
  <blockquote>
    <p>No signature of method:
    jdk.internal.net.http.HttpRequestBuilderImpl.PATCH() is applicable for
    argument types:
    (jdk.internal.net.http.RequestPublishers$StringPublisher) values:
    [jdk.internal.net.http.RequestPublishers$StringPublisher@280a600b]</p>
  </blockquote>
  
  <p>the call itself works great, for instance in Postman. But I cannot make it work in groovy/java.</p>
  
  <p>I used previously the <code>HttpUrlConnection</code> but it does not support PATCH. Is it actually possible using <code>HttpRequest</code>?</p>
  
  <p>I could not find any working example of the use of the PATCH method on the Net.</p>