Example usage for org.springframework.http RequestEntity patch

List of usage examples for org.springframework.http RequestEntity patch

Introduction

In this page you can find the example usage for org.springframework.http RequestEntity patch.

Prototype

public static BodyBuilder patch(URI url) 

Source Link

Document

Create an HTTP PATCH builder with the given url.

Usage

From source file:org.zalando.github.spring.TeamsTemplate.java

@Override
public Team updateTeam(long teamId, TeamRequest teamRequest) {
    Map<String, Object> uriVariables = new HashMap<>();
    uriVariables.put("teamid", teamId);

    RequestEntity<TeamRequest> entity = RequestEntity.patch(buildUri("/teams/{teamid}", uriVariables))
            .contentType(MediaType.APPLICATION_JSON).body(teamRequest);

    return getRestOperations().exchange(entity, Team.class).getBody();
}

From source file:org.zalando.github.spring.OrganizationsTemplate.java

@Override
public ExtOrganization updateOrganization(OrganizationUpdate update, String organization) {
    Map<String, Object> uriVariables = new HashMap<>();
    uriVariables.put("organization", organization);

    RequestEntity<OrganizationUpdate> entity = RequestEntity
            .patch(buildUri("/orgs/{organization}", uriVariables)).contentType(MediaType.APPLICATION_JSON)
            .body(update);/*  w w  w .ja va  2 s. c  o m*/

    return getRestOperations().exchange(entity, ExtOrganization.class).getBody();
}