![](/img/trans.png)
[英]Redirecting from http to https on SecureConnection is unable to pass values in POST request. How can I preserve them?
[英]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.