title: Retrofit 2.0 delete, put are not working
body: <p>I am giving a try to use Retrofit 2.0 to implement a library system.
  Which can add book, list all book info, list one book info, delete one book, delete all books, update one book info.</p>
  
  <p>My baseURL has a '<strong>/</strong>' in its end:</p>
  
  <pre><code>http://www.example.com/webservice/
  </code></pre>
  
  <p>The first three features work very well:</p>
  
  <pre><code>@GET("books")
  Call&lt;ArrayList&lt;Book&gt;&gt; listBooks();
  
  @POST("books")
  Call&lt;Book&gt; addBook(@Body Book book);
  
  @GET("books/{id}")
  Call&lt;Book&gt; getBookInfo(@Path("id") int bookId);
  </code></pre>
  
  <p>However, those three don't work at all:</p>
  
  <pre><code>@DELETE("books/{id}")
  Call&lt;Void&gt; deleteBook(@Path("id") int bookId);
  
  @PUT("books/{id}")
  Call&lt;Book&gt; updateBook(@Path("id") int bookId , @Body Book book);
  
  @DELETE("clean")
  Call&lt;Void&gt; deleteAll();
  </code></pre>
  
  <p>For example, this is my deleteBook feature:</p>
  
  <pre><code>        Gson gson = new GsonBuilder()
          .setDateFormat(Constant.DATE_FORMAT)
          .create();
  
  Retrofit retrofit = new Retrofit.Builder()
          .baseUrl(Constant.BASE_URL)
          .addConverterFactory(GsonConverterFactory.create(gson))
          .build();
  
  LibraryService libraryServiceAPI = retrofit.create(LibraryService.class);
  Call&lt;Void&gt; deleteBookCall = libraryServiceAPI.deleteBook(bookId);
  deleteBookCall.enqueue(new Callback&lt;Void&gt;() {
      @Override
      public void onResponse(Call&lt;Void&gt; call, Response&lt;Void&gt; response) {
          if (response.isSuccessful()) {
              if (response.code() == 204) { // I get 200 here, not 204
                  // but this is what I find:
                  // response--&gt;rawResponse--&gt;request--&gt;method == "GET"
                  // This should be DELETE, am I right?
              }
          } else {
              Log.d(DELETE_BOOK_ERROR, String.valueOf(response.code()));
          }
      }
  
      @Override
      public void onFailure(Call&lt;Void&gt; call, Throwable t) {
          Log.d(DELETE_BOOK_ERROR, RESPONSE_FAILURE);
      }
  });
  </code></pre>
  
  <p>When I debug the data: I find response-->rawResponse-->request-->method == "GET", which should be "DELETE" in this example. After I implement updateBook and deleteAll features, I find they have the same problem, here the methods both equals to "GET" rather than "PUT" and "DELETE".</p>
  
  <p>Can Someone help me to understand why it happens like this? Thanks a lot.</p>
  
  <p>Update 1: Add screenshot of debug info.
  <a href="https://i.stack.imgur.com/vIQZE.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/vIQZE.png" alt="response instance"></a></p>
  
  <p><a href="https://i.stack.imgur.com/UeHkm.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/UeHkm.png" alt="interface"></a></p>
  
  <p><a href="https://i.stack.imgur.com/6rTl9.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/6rTl9.png" alt="deleteBook function, response instance is highlighted"></a></p>
  
  <p>You will see in the response, check the request info, method is "GET", but tag shows method = "DELETE".</p>
  
  <p>Update2: With suggestion from Dexter, I add the HttpLoggingInterceptor for debugging,</p>
  
  <pre><code>            HttpLoggingInterceptor logging = new HttpLoggingInterceptor();
          logging.setLevel(HttpLoggingInterceptor.Level.BODY);
          OkHttpClient.Builder httpClient = new OkHttpClient.Builder();
          httpClient.interceptors().add(logging);
  
          Retrofit retrofit = new Retrofit.Builder()
                  .baseUrl(Constant.BASE_URL)
                  .addConverterFactory(GsonConverterFactory.create(gson))
                  .client(httpClient.build()).build();
  </code></pre>
  
  <p>Here are two pieces of log: </p>
  
  <ol>
  <li><code>@GET("books/{id}")
  Call&lt;Book&gt; getBookInfo(@Path("id") int bookId);</code>
  which is correct.</li>
  </ol>
  
  <blockquote>
    <p>03-28 00:26:00.842 3171-3198/com.xiaoyaoworm.prolificlibrary D/OkHttp:
    --> GET <a href="http://www.example.com/56eb7034cada930009ab0998/books/2" rel="nofollow noreferrer">http://www.example.com/56eb7034cada930009ab0998/books/2</a> http/1.1 03-28 00:26:00.842 3171-3198/com.xiaoyaoworm.prolificlibrary
    D/OkHttp: --> END GET 03-28 00:26:01.038
    3171-3198/com.xiaoyaoworm.prolificlibrary D/OkHttp: &lt;-- 200 OK
    <a href="http://www.example.com/56eb7034cada930009ab0998/books/2/" rel="nofollow noreferrer">http://www.example.com/56eb7034cada930009ab0998/books/2/</a> (191ms) 03-28
    00:26:01.038 3171-3198/com.xiaoyaoworm.prolificlibrary D/OkHttp:
    Connection: keep-alive 03-28 00:26:01.038
    3171-3198/com.xiaoyaoworm.prolificlibrary D/OkHttp: Server:
    gunicorn/18.0 03-28 00:26:01.038
    3171-3198/com.xiaoyaoworm.prolificlibrary D/OkHttp: Date: Mon, 28 Mar
    2016 06:03:30 GMT 03-28 00:26:01.038
    3171-3198/com.xiaoyaoworm.prolificlibrary D/OkHttp: Content-Type:
    application/json 03-28 00:26:01.038
    3171-3198/com.xiaoyaoworm.prolificlibrary D/OkHttp: Content-Length:
    153 03-28 00:26:01.038 3171-3198/com.xiaoyaoworm.prolificlibrary
    D/OkHttp: Via: 1.1 vegur 03-28 00:26:01.038
    3171-3198/com.xiaoyaoworm.prolificlibrary D/OkHttp:
    OkHttp-Sent-Millis: 1459139160940 03-28 00:26:01.038
    3171-3198/com.xiaoyaoworm.prolificlibrary D/OkHttp:
    OkHttp-Received-Millis: 1459139161040 03-28 00:26:01.038
    3171-3198/com.xiaoyaoworm.prolificlibrary D/OkHttp: {"author": "123",
    "categories": "123", "id": 2, "lastCheckedOut": null,
    "lastCheckedOutBy": null, "publisher": "123", "title": "123", "url":
    "/books/2/"} 03-28 00:26:01.038
    3171-3198/com.xiaoyaoworm.prolificlibrary D/OkHttp: &lt;-- END HTTP
    (153-byte body) 03-28 00:26:01.038
    3171-3171/com.xiaoyaoworm.prolificlibrary D/book info response code:
    Response status code: 200</p>
  </blockquote>
  
  <ol start="2">
  <li><code>@DELETE("books/{id}")
  Call&lt;Void&gt; deleteBook(@Path("id") int bookId);</code>
  which is not correct.</li>
  </ol>
  
  <blockquote>
    <p>03-28 00:26:35.602 3171-3198/com.xiaoyaoworm.prolificlibrary D/OkHttp:
    --> DELETE <a href="http://www.example.com/56eb7034cada930009ab0998/books/2" rel="nofollow noreferrer">http://www.example.com/56eb7034cada930009ab0998/books/2</a> http/1.1 03-28 00:26:35.602 3171-3198/com.xiaoyaoworm.prolificlibrary
    D/OkHttp: --> END DELETE 03-28 00:26:36.082
    3171-3198/com.xiaoyaoworm.prolificlibrary D/OkHttp: &lt;-- 200 OK
    <a href="http://www.example.com/56eb7034cada930009ab0998/books/2/" rel="nofollow noreferrer">http://www.example.com/56eb7034cada930009ab0998/books/2/</a> (481ms) 03-28
    00:26:36.082 3171-3198/com.xiaoyaoworm.prolificlibrary D/OkHttp:
    Connection: keep-alive 03-28 00:26:36.082
    3171-3198/com.xiaoyaoworm.prolificlibrary D/OkHttp: Server:
    gunicorn/18.0 03-28 00:26:36.082
    3171-3198/com.xiaoyaoworm.prolificlibrary D/OkHttp: Date: Mon, 28 Mar
    2016 06:04:05 GMT 03-28 00:26:36.082
    3171-3198/com.xiaoyaoworm.prolificlibrary D/OkHttp: Content-Type:
    application/json 03-28 00:26:36.082
    3171-3198/com.xiaoyaoworm.prolificlibrary D/OkHttp: Content-Length:
    153 03-28 00:26:36.082 3171-3198/com.xiaoyaoworm.prolificlibrary
    D/OkHttp: Via: 1.1 vegur 03-28 00:26:36.082
    3171-3198/com.xiaoyaoworm.prolificlibrary D/OkHttp:
    OkHttp-Sent-Millis: 1459139195900 03-28 00:26:36.082
    3171-3198/com.xiaoyaoworm.prolificlibrary D/OkHttp:
    OkHttp-Received-Millis: 1459139196088 03-28 00:26:36.082
    3171-3198/com.xiaoyaoworm.prolificlibrary D/OkHttp: {"author": "123",
    "categories": "123", "id": 2, "lastCheckedOut": null,
    "lastCheckedOutBy": null, "publisher": "123", "title": "123", "url":
    "/books/2/"} 03-28 00:26:36.082
    3171-3198/com.xiaoyaoworm.prolificlibrary D/OkHttp: &lt;-- END HTTP
    (153-byte body)</p>
  </blockquote>