繁体   English   中英

如何从 HTTP POST 请求更改为 HTTPS POST 请求?

[英]How to change from a HTTP POST request to HTTPS POST request?

我现在有一个使用此布局的 HTTP POST 请求:

private static readonly HttpClient client = new HttpClient();

var values = new Dictionary<string, string>
{
   { "thing1", "hello" },
   { "thing2", "world" }
};

var content = new FormUrlEncodedContent(values);

var response = await client.PostAsync("https://www.example.com/recepticle.aspx", content); //It's not the URL I'm using.

var responseString = await response.Content.ReadAsStringAsync();

我想使用 C# 的 POST 请求在网站上设置密码(文本框)。 我尝试了上面的布局,但没有设置它。 所以我认为这是因为我使用的是 HTTP 请求而不是 HTTPS 请求(你认为我是对的吗?)。 我的问题是,我不知道如何将其作为 HTTPS 请求发送。 我需要一种方法来使其成为 HTTPS。

我可能应该澄清一下,我正在发送以下内容:

Password, - Not in the textbox
Password again, - Not in the textbox 
question index, - In the textbox
answer for the question, - In the textbox
terms_of_service. - Not in the textbox

所以我想该网站确实处理了我的请求,但并不关心其中的某些内容。 也许是饼干?

先感谢您。

显然,该网站确实处理并收到了我寄给他的东西,但它从未将它们寄回给我,因为安全。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM