Home >Backend Development >C++ >How to Customize the Authorization Header for HttpClient in WinRT?
When using HTTPClient for REST API interaction, the configuration authorization header is essential. If you encounter a problem when you use the authorization head to set up the tokens required by OAUTH request, this article will provide a solution to effective work in the Winrt environment.
Solution
Unlike .NET, Winrt did not provide a Credential class. However, there is a simple alternative method that can achieve the expected effect:
By using the AuthenticationHeadervalue class and specify the "Bearer" solution, you can easily set the authorized head to the corresponding token. This solution is particularly suitable for Winrt applications, allowing you to establish secure communication with the REST API that needs authentication.
The above is the detailed content of How to Customize the Authorization Header for HttpClient in WinRT?. For more information, please follow other related articles on the PHP Chinese website!