55 lines
1.1 KiB
HTTP
55 lines
1.1 KiB
HTTP
|
|
@me = {{$processEnv USER}}:
|
|
@bookshop = http://localhost:4004
|
|
@reviews-service = {{bookshop}}/reviews
|
|
|
|
# Uncomment this when running separate reviews service
|
|
# @reviews-service = http://localhost:5005/reviews
|
|
|
|
|
|
|
|
#################################################
|
|
#
|
|
# To ReviewsService
|
|
#
|
|
# move the right down:
|
|
|
|
### Get all reviews
|
|
GET {{reviews-service}}/Reviews
|
|
|
|
### Add a new review (with random rating)
|
|
POST {{reviews-service}}/Reviews
|
|
Content-Type: application/json;IEEE754Compatible=true
|
|
Authorization: Basic {{me}}
|
|
|
|
{"subject":"201", "title":"boo" }
|
|
|
|
|
|
|
|
#################################################
|
|
#
|
|
# Bookshop Requests involving reviews
|
|
# (both in-process as well as separate one)
|
|
#
|
|
|
|
### Request to CatalogService > delegated to ReviewsService
|
|
GET {{bookshop}}/browse/Books(201)/reviews?
|
|
&$select=rating,date,reviewer,title
|
|
|
|
### Alternative OData URL
|
|
GET {{bookshop}}/browse/Books/201/reviews?
|
|
&$select=rating,date,title
|
|
&$top=3
|
|
|
|
###
|
|
GET {{bookshop}}/browse/Books(201)?
|
|
&$select=ID,title,rating
|
|
&$expand=reviews
|
|
# Note: the $expand only works in case of ReviewsService in same process
|
|
|
|
|
|
|
|
###
|
|
|
|
GET {{bookshop}}/orders/Orders
|