January 2018
Intermediate to advanced
336 pages
7h 56m
English
The routes defined for Service allow users to create a new service, query for its properties, and delete it. As of now, for Auth interceptor, assume that 123 is a valid token that is sent in the header of each request. Here are a sample of cURL requests to create, query, and delete a service offered by the Helping Hands application:
;; Create a new service with required parameters% curl -i -H "token: 123" -XPUT -d "type=A&provider=1&area=bangalore&cost=250" http://localhost:8080/services/1HTTP/1.1 200 OK...{"service/id":"1","service/type":"A","service/provider":"1","service/area":["bangalore"],"service/cost":250.0};; Get service properties by ID% curl -i -H "token: 123" http://localhost:8080/services/1HTTP/1.1 200 OK...{"service/id":"1","service/type":"A","service/provider":"1","service/area":["bangalore"],"service/cost":250.0} ...Read now
Unlock full access