任何人都可以帮我翻译这个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 –