Created
February 25, 2015 05:58
-
-
Save adityasatrio/cf6b9986747d0e99bf02 to your computer and use it in GitHub Desktop.
Post Rest using spring mvc - restTemplate
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pom.xml : | |
<spring-framework.version>4.1.1.RELEASE</spring-framework.version> | |
<dependency> | |
<groupId>org.springframework</groupId> | |
<artifactId>spring-web</artifactId> | |
<version>${spring-framework.version}</version> | |
</dependency> | |
implementation : | |
public static final String REST_SERVER = "http://localhost:8080/MIA-WS"; | |
public static final String GET_TOTAL_SHIPMENT_AND_PIECES = "/rest/total/shipment/pieces"; | |
Map<String, String> paramMap = new HashMap<String, String>(); | |
paramMap.put("paramater","parameter"); | |
RestTemplate restTemplate = new RestTemplate(); | |
String urlRest = Constants.REST_SERVER + Constants.GET_TOTAL_SHIPMENT_AND_PIECES; | |
List<Object> returnValue = restTemplate.postForObject(urlRest, paramMap, List.class); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment