我想实现一个C#应用程序。用于通过http发送cURL推荐(以下)。我需要采纳您的宝贵建议,这些建议可以使用“ -v”命令或其他方式来实现以下cURL命令。
卷曲“ https://naveropenapi.apigw.ntruss.com/map-direction/v1/driving?start=127.1058342,37.359708&goal=129.075986,35.179470&option=trafast” \ -H“ X-NCP-APIGW-API-KEY-ID:ID” \ -H“ X-NCP-APIGW-API-KEY:秘密” -v
我实现了以下代码,但由于出现“ -v”,因此无法正常工作。我已经尝试使用https://curl.olsh.me/,但是该网站未提供“ -v”的转换。
static void Main(string[] args)
{
MainAsync().Wait();
}
static async Task MainAsync()
{
using (var httpClient = new HttpClient())
{
using (var request = new HttpRequestMessage(new HttpMethod("GET"), "https://naveropenapi.apigw.ntruss.com/map-direction/v1/driving?start=127.1058342,37.359708&goal=129.075986,35.179470&option=trafast"))
{
request.Headers.TryAddWithoutValidation("X-NCP-APIGW-API-KEY-ID", "ID");
request.Headers.TryAddWithoutValidation("X-NCP-APIGW-API-KEY", "Secret");
var response = await httpClient.SendAsync(request);
JObject JSON = (JObject)JToken.FromObject(response);
}
}
}