how to pass in tokens for authentification in https request

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By iamkhan

i need to access a web content using token how to put one in httprequest

:bust_in_silhouette: Reply From: Calinou

If this is a JSON Web Token or a similar mechanism, you need to pass the Authorization HTTP header in your request with the value Bearer (your token here).

You can pass custom headers to HTTPRequest’s request() function with the optional second parameter which is an array of strings of the form Key: Value.