beautified bookshop/requests.http

This commit is contained in:
Daniel
2020-04-18 13:25:08 +02:00
parent 0ed239b28b
commit 50428b4d26
2 changed files with 41 additions and 30 deletions

View File

@@ -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;
}

View File

@@ -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}}