Created
June 24, 2012 02:31
-
-
Save ajaykumarns/2981121 to your computer and use it in GitHub Desktop.
Retrieve Product by id
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
package com.anadathur.springapp1; | |
import org.springframework.web.client.RestTemplate; | |
import com.anadathur.springapp1.model.Product; | |
public class ProductById{ | |
public static void main(String [] args){ | |
RestTemplate template = new RestTemplate(); | |
Product product = template.getForObject("http://kick-ass-product/api/product/{id}", Product.class, 123); | |
System.out.println("Product retrieved: " + product); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment