HttpClient Header Authorization to php

Hi

I have the blow code in my C# app:

var clientHandler = new HttpClientHandler();
var client = new HttpClient(clientHandler);
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", "Your Oauth token");

How can I access this Authorization key in my backend’s PHP?

Thanks,
Jassim

Well, this is not a PHP question, but…

In PHP, you pass data, such as a “key” using something like: <?PHP echo $key; ?>
This would put the value of the variable $key into the output string passed to the HTML browser.
Since C# is processed on the server, you would NOT have any interaction with PHP directly unless the PHP code “calls” the C# code. This is easy to do using a simple “wrapper”…

Now with all that said, explain what you actually need done and we can help…
Remember the C# code has nothing directly to do with PHP. PHP can “call” a C# routine and pas data to it.

Doubt this helps.

Sponsor our Newsletter | Privacy Policy | Terms of Service