#215 - Fixed Traverson constructor usage in readme.
This commit is contained in:
committed by
Oliver Gierke
parent
67aa51dbea
commit
f4c43b26c4
@@ -315,7 +315,7 @@ As of version 0.11 Spring HATEOAS provides an API for client side service traver
|
||||
Map<String, Object> parameters = new HashMap<>();
|
||||
parameters.put("user", 27);
|
||||
|
||||
Traverson traverson = new Traverson("http://localhost:8080/api/", MediaTypes.HAL_JSON);
|
||||
Traverson traverson = new Traverson(new URI("http://localhost:8080/api/"), MediaTypes.HAL_JSON);
|
||||
String name = traverson.follow("movies", "movie", "actor").
|
||||
withTemplateParameters(parameters).
|
||||
toObject("$.name");
|
||||
@@ -323,4 +323,4 @@ String name = traverson.follow("movies", "movie", "actor").
|
||||
|
||||
You set up a `Traverson` instance by pointing it to a REST server and configure the media types you want to set as `Accept` header. You then go ahead and define the relation names you want to discover and follow. relation names can either be simple names or JSONPath expressions (starting with an `$`).
|
||||
|
||||
The sample then hands a parameter map into the execution. The parameters will be used to expand URIs found during the traversal that are templated. The traversal is concluded by accessing the representation of the final traversal. In the case of the sample we evaluate a JSONPath expression to access the actor's name.
|
||||
The sample then hands a parameter map into the execution. The parameters will be used to expand URIs found during the traversal that are templated. The traversal is concluded by accessing the representation of the final traversal. In the case of the sample we evaluate a JSONPath expression to access the actor's name.
|
||||
|
||||
Reference in New Issue
Block a user