README_VERBS.md
April 25, 2022 ยท View on GitHub
GET
HEAD
GET with Params
You can specify your entire route in the parameters query string param.
eg. you may want to hit
GET http://localhost:63990/student/{year}/subject/{code}?division={division}
route on the back end API.
You will set up the Orchestration as
orchestrator.AddApi("schoolservice", "http://localhost:63990/")
.AddRoute("year-subject", GatewayVerb.GET, new RouteInfo { Path = "student/" });
And call the GET endpoint as
Or
Parameterized route
You will set up a parameterized route in the Orchestration as
orchestrator.AddApi("schoolservice", "http://localhost:63990/")
.AddRoute("year-subject", GatewayVerb.GET, new RouteInfo { Path = "student/{year}/subject/{code}?division={division}" })
And call the GET endpoint as
Any param in the Path (eg. {year}) will be substituted by what is passed in the Parameters field in the request.
So, the Path would become student/2020/subject/001?division=A.