January 2018
Intermediate to advanced
336 pages
7h 56m
English
The routes defined for the Provider service allow users to create a new provider, query for its properties, and delete it. As of now, for the Auth interceptor, assume that 123 is a valid token that is sent in the header of each request. To start with, create a provider using the PUT /providers/:id route with ID set as 1:
% curl -i -H "token: 123" -XPUT -d "name=ProviderA" http://localhost:8080/providers/1HTTP/1.1 200 OK...{"provider/id":"1","provider/name":"ProviderA"}
To add a rating, use the PUT /providers/:id/rate route with the same ID as that of ProviderA:
% curl -i -H "token: 123" -XPUT -d "rating=5.0" http://localhost:8080/providers/1/rateHTTP/1.1 200 OK...{"provider/id":"1","provider/name":"ProviderA","provider/rating":[5.0]} ...Read now
Unlock full access