We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Could you possibly add rest request samples with custom headers and with Basic and Bearer support?
The text was updated successfully, but these errors were encountered:
Did you find them?
https://xkcd.com/979/
Sorry, something went wrong.
@Kinrany Not sure if we have samples that illustrate this, but custom headers can be passed in here.
So you would set this up by doing something like:
import * as rm from 'typed-rest-client/RestClient'; import * as hm from 'typed-rest-client/Handlers' const basicHandler: hm.BasicCredentialHandler = new hm.BasicCredentialHandler(username, password); const bearerHandler: hm.BearerCredentialHandler = new hm.BearerCredentialHandler(token); const options: rm.IRequestOptions = <rm.IRequestOptions>({ additionalHeaders: { 'key1': val1, 'key2': val2, ... }) let restc: rm.RestClient = new rm.RestClient('rest-samples', baseUrl, [authHandler, bearerHandler]); let restRes: rm.IRestResponse<~responseType~> = await restc.get<~responseType~>('get', options);
@damccorm thanks :D
No branches or pull requests
Could you possibly add rest request samples with custom headers and with Basic and Bearer support?
The text was updated successfully, but these errors were encountered: