For instance, Twitter API. When making basic requests Twitter API requires a Bearer token for authorization. To receive it, you wish to send a token request and transfer base64 encoded api key and secret key in the course of the Authorization field. First, you want to attach the TextToBinaryData and BinaryToBase64 applications from the BinaryData module in the dependencies. Then make sure to encode the “ApiKey: ApiSecretKey” string using TextToBinaryData and move the result to BinaryToBase64.
Write “Basic” + BinaryToBase64. Base64 in the Authorization header of the REST request for a token. In response you get hold of access token, which can be used for further requests in the Authorization: “Bearer” + access token.