curl集成在c#中 [英] Curl integrated in c#
本文介绍了curl集成在c#中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
Hello!
推荐答案
卷曲是只是HTTP调用的命令行包装器。在.NET中,您可以使用
HttpClient 做同样的事情。
var client = new HttpClient()
{
BaseAddress = "http:10.194.*****"
};
var myData = new {
node_id = 3,
value = 100
};
//In an async/await method
var response = await client.PostAsJsonAsync("dimmers/set_level", myData);
If你真的想依赖像curl这样的外部命令(必须安装到系统可以访问的路径中)然后使用
Process.Start
If you really want to rely on an external command like curl (which must be installed into a path that is accessible by the system) then use
Process.Start
这篇关于curl集成在c#中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文