任何人都可以幫我翻譯這個curl命令到C#https GET請求嗎?curl命令到C#mbed API
curl -v -H 'Authorization: Bearer <your_access_key>' https://api.connector.mbed.com/endpoints/
任何人都可以幫我翻譯這個curl命令到C#https GET請求嗎?curl命令到C#mbed API
curl -v -H 'Authorization: Bearer <your_access_key>' https://api.connector.mbed.com/endpoints/
試試這個:
WebClient client = new WebClient();
client.Headers.Add("Authorization", "Bearer <your_access_key>");
string response = client.DownloadString("https://api.connector.mbed.com/endpoints/");
非常感謝您的回答,它與引號內的URI一起工作 –
如果答案解決了您的問題,請打勾答案爲「已接受」(帶有小複選框)。謝謝! –
對不起,我是新來的,這實際上是我的第一個問題 –
你嘗試過什麼到目前爲止? –
['WebClient'](https://msdn.microsoft.com/library/system.net.webclient)是你的朋友。 –
或帶額外頭文件的HttpClient。 https://stackoverflow.com/questions/35907642/custom-header-to-httpclient-request –