I. C # the client sends data to the specified URL through POST or GET
Send request /// <Summary>
/// Send the request
/// </Summary>
/// <Param name = "url"> url </param>
/// <Param name = "parameter"> value to be sent. For example, abc = 4 & bcd = 5 </param>
/// <Param name = "method"> sending method, "POST" or "GET" </param>
/// <Returns> returned results </returns>
Public static string RequestUrl (string url, string parameter, string method)
{
Try
{
HttpWebRequest hwrq = null;
If (method = "POST ")
{
Hwrq = (HttpWebRequest) HttpWebRequest. Create (url );
Hwrq. KeepAlive = false;
Hwrq. ReadWriteTimeout = 10000;
// Hwrq. CookieContainer = cc;
Hwrq. Method = method;
Byte [] postData = System. Text. Encoding. UTF8.GetBytes (parameter );
Hwrq. ContentType = "application/x-www-form-urlencoded ";
Hwrq. ContentLength = postData. Length;
Stream writeStream = hwrq. GetRequestStream ();
WriteStream. Write (postData, 0, postData. Length );
WriteStream. Close ();
}
Else if (method = "GET ")
{
Hwrq