v0.9.0
Authentication header 🆕
For the Authentication header there's a new helper s.auth which supports Bearer and Basic authentication schemes.
let getPosts = Rest.route(() => {
path: "/posts",
method: Get,
variables: s => {
"token": s.auth(Bearer),
},
responses: [
s => s.data(S.array(postSchema)),
],
})
let result = await client.call(
getPosts,
{
"token": "abc",
}
) // ℹ️ It'll do a GET request to http://localhost:3000/posts with the `{"authorization": "Bearer abc"}` headersFull Changelog: v0.8.0...v0.9.0