Creates a RouteFetcher
instance that can be used to execute an HTTP request
based on the given route schema.
let TestRoute = await RouteFetcher(TestRouteSchema)
let response = await TestRoute.get({
query: {
name: 'Simon'
}
})
if (response.status === 200) {
console.log(response.body.message)
}
Unsupported content types do not have a populated body
field. Please use
one of fetch
's body consumption functions.
if (response.contentType === 'application/octet-stream') {
let buf = await response.res.arrayBuffer()
}
The route schema of the route to request.
Additional fetching options.
Generated using TypeDoc
Use
RouteFetcher(schema)
to create aRouteFetcher
instance.