I’m developing on my project and I’m new to ASP.NET.
I want to send HTTP post request to a socket when I hit a button
here is my code.
protect void Button1_click(object sender, EventArgs e)
{
socket clientSocket = new Socket (addressFamily.InterNetwork, SocketType.Stream, Protocol.TCP);
clientSocket.Connect(new IPEndPont.Parse("192.168.1.1", 5550));
A = "1"; // i want to send this variable using HTTP post request
clientSocket.Send(Encoding.UTF8.Getbytes(A));
clientSocket.Close();
}
tnx for helping.
You could use something like the code below to send an HTTP request using POST Method…
A socket (Server + Port) will be automatically created to handle the data on the server to process the request.
Hope this helps..