-
RestTemplatemakes interacting with most RESTful services a one-line incantation. And it can even bind that data to custom domain types. - As you can see, this is a simple Java class with a handful of properties and matching getter methods. It’s annotated with
@JsonIgnorePropertiesfrom the Jackson JSON processing library to indicate that any properties not bound in this type should be ignored. - Because the Jackson JSON processing library is in the classpath,
RestTemplatewill use it (via a message converter) to convert the incoming JSON data into aPageobject. From there, the contents of thePageobject will be printed to the console.Here you’ve only usedRestTemplateto make an HTTPGETrequest. ButRestTemplatealso supports other HTTP verbs such asPOST,PUT, andDELETE. - http://spring.io/guides/gs/consuming-rest/
Apart from coding and design interview questions, this page contains updates on my learnings with Java. It helps me organize my learning. Read about my future self here : https://siliconvalleystories.blogspot.com/
Sunday, 3 August 2014
Consuming REST Services using Spring
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment