小编Skr*_*ord的帖子

如何在Web客户端的post请求中发送x-www-form-urlencoded?

我知道我可以发送 json,但我找不到如何发送 x-www-form-urlencoded。我不知道该尝试什么,因为我找不到任何东西。

WebClient wc = new WebClient();


string data = "channel_id=+12039273888&channel_type=phone&channel_verification=514950";

wc.Headers[HttpRequestHeader.ContentType] = "application/x-www-form-urlencoded";

string result = wc.UploadString("http://3.86.171.88/api/login", data);

System.Console.WriteLine(result);
Run Code Online (Sandbox Code Playgroud)

c# webclient

3
推荐指数
2
解决办法
3万
查看次数

标签 统计

c# ×1

webclient ×1