Skip to content

Add support for DELETE with body to AsyncRestTemplate [SPR-12291] #16896

Closed

Description

@spring-projects-issues

Oana Goanta opened SPR-12291 and commented

When making a DELETE request with a non empty request body using an AsyncRestClient with the default options (created with a AsyncClientHttpRequestFactory parameter, obtained using default configurations of for HttpAsyncClientBuilder) , the body is not actually attached to the request.

public <T> ListenableFuture<ResponseEntity<T>> exchange(String url, HttpMethod.DELETE, HttpEntity<?> requestEntity, Class<T> responseType, Map<String, ?> uriVariables) , where requestEntity.body is not null or empty.

The only workaround for this limitation that I found is described here: http://knowledgebrowse.blogspot.ro/2013/08/spring-resttemplate-calling-delete.html


Affects: 4.0 GA

Issue Links:

Activity

  1. spring-projects-issues commented on Oct 2, 2014

    @spring-projects-issues
    CollaboratorAuthor

    Juergen Hoeller commented

    The use of a body with a DELETE request is generally questionable, e.g. following this discussion:
    http://stackoverflow.com/questions/299628/is-an-entity-body-allowed-for-an-http-delete-request

    That said, if a body has been specified, (Async)RestTemplate arguably shouldn't simply ignore it but rather follow the caller's intention and pass it on.

    Juergen

  2. spring-projects-issues commented on Oct 2, 2014

    @spring-projects-issues
    CollaboratorAuthor
  3. spring-projects-issues commented on Oct 27, 2014

    @spring-projects-issues
    CollaboratorAuthor

    Rossen Stoyanchev commented

    This should now be resolved due to #16966.

  4. added
    type: enhancement
    in: core
    status: duplicate
    on Jan 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

in: corestatus: duplicatetype: enhancement

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions