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

View File

@@ -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)
###