title: Java - RestTemplate 405 Method Not Allowed Although Postman Call Works
body: <p>I am experiencing a weird issue when working with RestTemplate. I'm using a certain REST API and there I want to update something using PUT.
  Thus, in e.g. Postman I am sending this request:</p>
  
  <pre><code>PUT http://fake/foobar/c/123 with a certain body
  </code></pre>
  
  <p>This update via Postman is successful. If I now execute the same call in Java via a <code>RestTemplate</code>, I am getting a 405 Method Not Allowed:</p>
  
  <pre><code>HttpHeaders headers = createHeader();
  HttpEntity&lt;Offer&gt; httpEntity = new HttpEntity&lt;&gt;(bodyEntity, headers);
  String url = "http://fake/foobar/c/123"; //Created dynamically, but here pasted for sake of simplicity
  RestTemplate restTemplate = new RestTemplate(...);
  ResponseEntity&lt;OfferResponse&gt; response = restTemplate.exchange(url, HttpMethod.PUT, httpEntity, OfferResponse.class);
  ...
  </code></pre>
  
  <p>I compared the URL again and again. If I copy the URL logged in the console and copy it to Postman, I can do the update successfully. I also compared the headers and everything. Everything is equal to how it is done via Postman.</p>
  
  <p>Is there any potential other reason for such a behavior (another reason than I am too stupid comparing the headers etc. and missing something)? Other PUT, POST calls etc. against this API are working fine, otherwise I would have assumed that there is a general problem with my usage of <code>RestTemplate</code></p>