I need to redirect the user to http://www.someurl.com?id=2 using the POST method.
Is it possible? If so, how?
I am following him now and it is correctly transmitting the POST data, but is it deleting the identifier? id = 2:
HttpWebRequest request = (HttpWebRequest)WebRequest.Create("http://www.someurl.com?id=2");
request.Method = WebRequestMethods.Http.Post;
request.ContentType = "application/x-www-form-urlencoded";
request.ContentLength = postData.Length;
using (StreamWriter writer = new StreamWriter(request.GetRequestStream()))
{
writer.Write(postData);
}
HttpWebResponse response = (HttpWebResponse)request.GetResponse();
using (StreamReader reader = new StreamReader(response.GetResponseStream()))
{
Response.Write(reader.ReadToEnd());
}
Do I need query string data →? id = 2 and POST data, because I pass the request string to the page in which javascript will process the data of the query string, and .NET will work with the data sent by the POST method. The POST data I pass may be longer than the maximum number of characters that the GET method allows, so I can’t use only the GET method ... so what are your suggestions?
:
, , , , URL-, . , - , , , POST, GET HEADER, , .