beautified bookshop/requests.http
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
using { sap.capire.bookshop as my } from '../db/schema';
|
using { sap.capire.bookshop as my } from '../db/schema';
|
||||||
service AdminService @(_requires:'authenticated-user') {
|
service AdminService @(requires_:'admin') {
|
||||||
entity Books as projection on my.Books;
|
entity Books as projection on my.Books;
|
||||||
entity Authors as projection on my.Authors;
|
entity Authors as projection on my.Authors;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,40 +1,51 @@
|
|||||||
GET http://localhost:4004/browse
|
@server = http://localhost:4004
|
||||||
###
|
@me = Authorization: Basic {{$processEnv USER}}:
|
||||||
|
|
||||||
GET http://localhost:4004/browse/$metadata
|
|
||||||
###
|
|
||||||
|
|
||||||
|
|
||||||
GET http://localhost:4004/browse/Books?
|
### ------------------------------------------------------------------------
|
||||||
&$select=title,stock
|
# Get service info
|
||||||
&$expand=currency
|
GET {{server}}/browse
|
||||||
#> add @capire/common to see data for currencies
|
{{me}}
|
||||||
# &sap-language=de
|
|
||||||
###
|
|
||||||
|
|
||||||
|
|
||||||
GET http://localhost:4004/admin/Authors?
|
### ------------------------------------------------------------------------
|
||||||
# &$select=name,dateOfBirth,placeOfBirth
|
# Get $metadata document
|
||||||
&$expand=books($select=title;$expand=currency)
|
GET {{server}}/browse/$metadata
|
||||||
#> add @capire/common to see data for currencies
|
{{me}}
|
||||||
# &$filter=ID eq 101
|
|
||||||
&sap-language=de
|
|
||||||
###
|
|
||||||
|
|
||||||
|
|
||||||
POST http://localhost:4004/browse/submitOrder
|
### ------------------------------------------------------------------------
|
||||||
# Run that three times to get out-of-stock message
|
# Browse Books as any user
|
||||||
|
GET {{server}}/browse/Books?
|
||||||
|
# &$select=title,stock
|
||||||
|
# &$expand=currency
|
||||||
|
# &sap-language=de
|
||||||
|
{{me}}
|
||||||
|
|
||||||
|
|
||||||
|
### ------------------------------------------------------------------------
|
||||||
|
# Fetch Authors as admin
|
||||||
|
GET {{server}}/admin/Authors?
|
||||||
|
# &$select=name,dateOfBirth,placeOfBirth
|
||||||
|
# &$expand=books($select=title;$expand=currency)
|
||||||
|
# &$filter=ID eq 101
|
||||||
|
# &sap-language=de
|
||||||
|
Authorization: Basic alice:
|
||||||
|
|
||||||
|
|
||||||
|
### ------------------------------------------------------------------------
|
||||||
|
# Submit Order as authenticated user
|
||||||
|
# (send that three times to get out-of-stock message)
|
||||||
|
POST {{server}}/browse/submitOrder
|
||||||
Content-Type: application/json
|
Content-Type: application/json
|
||||||
|
{{me}}
|
||||||
|
|
||||||
{ "book":201, "amount":5 }
|
{ "book":201, "amount":5 }
|
||||||
###
|
|
||||||
|
|
||||||
|
|
||||||
|
### ------------------------------------------------------------------------
|
||||||
GET http://localhost:4004/browse/Genres?
|
# Browse Genres
|
||||||
###
|
GET {{server}}/browse/Genres?
|
||||||
|
# &$filter=parent_ID eq null&$select=name
|
||||||
GET http://localhost:4004/browse/Genres?
|
# &$expand=children($select=name)
|
||||||
&$filter=parent_ID eq null&$select=name
|
{{me}}
|
||||||
&$expand=children($select=name)
|
|
||||||
###
|
|
||||||
|
|||||||
Reference in New Issue
Block a user