java.lang.IllegalArgumentException: Non-body HTTP method cannot contain @Body.
generator code
@DELETE("device/flexEng/tenant")
Call
@retrofit2.http.Body FlexEngTenantDeleteParam flexEngTenantDeleteParam
);
Adjust to
@HTTP(method = "DELETE",path = "/device/flexEng/tenant",hasBody = true)
Call
@retrofit2.http.Body FlexEngTenantDeleteParam flexEngTenantDeleteParam
);
2.2.3 version
DELETE ops shouldn't have a request body. The entity to delete should be fully identified in the URL.
DELETE ops shouldn't have a request body.
The HTTP spec does not explicitly forbid request bodies in DELETE requests. See https://tools.ietf.org/html/rfc7231#section-4.3.5
The entity to delete should be fully identified in the URL.
This is fine if your endpoint is designed to delete a single entity, but I need to perform a bulk delete of many entities within a single transaction. I'm not going to jam a potentially large number of entity IDs into the path or query string. It would be very handy to be able to send a DELETE request with a JSON body like:
[ "id-1", "id-2", "id-3", ..., "id-1000" ]
Since I can't do this I'll have to use a POST with an endpoint like /entity/type/bulkRemove which is not very RESTy. Swagger/retrofit should be less opinionated on this topic.
Most helpful comment
The HTTP spec does not explicitly forbid request bodies in
DELETErequests. See https://tools.ietf.org/html/rfc7231#section-4.3.5This is fine if your endpoint is designed to delete a single entity, but I need to perform a bulk delete of many entities within a single transaction. I'm not going to jam a potentially large number of entity IDs into the path or query string. It would be very handy to be able to send a
DELETErequest with a JSON body like:Since I can't do this I'll have to use a
POSTwith an endpoint like/entity/type/bulkRemovewhich is not very RESTy. Swagger/retrofit should be less opinionated on this topic.