beautified bookshop/requests.http
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
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 Authors as projection on my.Authors;
|
||||
}
|
||||
|
||||
@@ -1,40 +1,51 @@
|
||||
GET http://localhost:4004/browse
|
||||
###
|
||||
|
||||
GET http://localhost:4004/browse/$metadata
|
||||
###
|
||||
@server = http://localhost:4004
|
||||
@me = Authorization: Basic {{$processEnv USER}}:
|
||||
|
||||
|
||||
GET http://localhost:4004/browse/Books?
|
||||
&$select=title,stock
|
||||
&$expand=currency
|
||||
#> add @capire/common to see data for currencies
|
||||
# &sap-language=de
|
||||
###
|
||||
### ------------------------------------------------------------------------
|
||||
# Get service info
|
||||
GET {{server}}/browse
|
||||
{{me}}
|
||||
|
||||
|
||||
GET http://localhost:4004/admin/Authors?
|
||||
# &$select=name,dateOfBirth,placeOfBirth
|
||||
&$expand=books($select=title;$expand=currency)
|
||||
#> add @capire/common to see data for currencies
|
||||
# &$filter=ID eq 101
|
||||
&sap-language=de
|
||||
###
|
||||
### ------------------------------------------------------------------------
|
||||
# Get $metadata document
|
||||
GET {{server}}/browse/$metadata
|
||||
{{me}}
|
||||
|
||||
|
||||
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
|
||||
{{me}}
|
||||
|
||||
{ "book":201, "amount":5 }
|
||||
###
|
||||
|
||||
|
||||
|
||||
GET http://localhost:4004/browse/Genres?
|
||||
###
|
||||
|
||||
GET http://localhost:4004/browse/Genres?
|
||||
&$filter=parent_ID eq null&$select=name
|
||||
&$expand=children($select=name)
|
||||
###
|
||||
### ------------------------------------------------------------------------
|
||||
# Browse Genres
|
||||
GET {{server}}/browse/Genres?
|
||||
# &$filter=parent_ID eq null&$select=name
|
||||
# &$expand=children($select=name)
|
||||
{{me}}
|
||||
|
||||
Reference in New Issue
Block a user