January 2018
Intermediate to advanced
336 pages
7h 56m
English
The routes defined for the Consumer service allow users to create a new consumer, 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 consumer using the PUT /consumers/:id route with the ID set as 1, as shown here:
% curl -i -H "token: 123" -XPUT -d "name=ConsumerA" http://localhost:8080/consumers/1HTTP/1.1 200 OK...{"consumer/id":"1","consumer/name":"ConsumerA"}
It creates a new consumer and returns the consumer entity. To add a new field, use the same API with the same consumer ID and specify the new fields. It will do an upsert operation on the entity and add the new fields, as shown here:
curl -i ...
Read now
Unlock full access