flurl发送urlencode请求

var response = await fullUrl
	.WithHeaders(new
	{
	    Content_Type = "application/x-www-form-urlencoded"
	})
	.PostAsync(new StringContent("a=1&b=2"));
//var content = new CapturedStringContent(data);//使用这种content不成功
var resStr = await response.ResponseMessage.Content.ReadAsStringAsync();
return (true, resStr);

或者

await "http://site.com/login".PostUrlEncodedAsync(new { 
    user = "user", 
    pass = "pass"
});

你可能感兴趣的:(dotnet,java,前端,服务器)