title: Invalid HTTP method: PATCH
body: <p>After trying other solutions from <a href="https://stackoverflow.com/questions/25163131/httpurlconnection-invalid-http-method-patch">HttpURLConnection Invalid HTTP method: PATCH</a></p>
  <p>I am getting Invalid HTTP Method: PATCH Exception with JAVA 7.
  Updating JAVA is not in option so i have to stick to the workarounds.</p>
  <p>I am using Invocation to invoke the request like this</p>
  <pre><code>Invocation invoke = reqBuilder.build(getHTTPVerb(), Entity.entity(requestJSON, MediaType.APPLICATION_JSON));
  getWebTarget().request(MediaType.APPLICATION_JSON).header(&quot;Authorization&quot;, getAuthorization()).accept(MediaType.APPLICATION_JSON);
  </code></pre>
  <p><code>getHTTPVerb()</code> returns String &quot;POST&quot; or &quot;PATCH&quot;.</p>
  <p>With PATCH method I am having problem.</p>
  <p>In the mentioned question, i have not tried one solution with:</p>
  <pre><code>conn.setRequestProperty(&quot;X-HTTP-Method-Override&quot;, &quot;PATCH&quot;);
  conn.setRequestMethod(&quot;POST&quot;);
  </code></pre>
  <p><code>conn</code> is <code>HttpURLConnection</code>  instance.</p>
  <p>But I am not sure how I can get <code>HttpURLConnection</code> from Invocation class or any property.</p>
  <p>Any pointers or help would be highly appreciated.</p>