Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>For C#, I prefer to use <a href="http://www.codeproject.com/KB/IP/httpwebrequest_response.aspx" rel="nofollow noreferrer">HttpWebRequest</a> over WebClient because you can have more option in the future like having GET/POST parameter, using Cookies, etc.</p> <p>You can have a shortest explication at <a href="http://msdn.microsoft.com/en-us/library/system.net.httpwebrequest.begingetrequeststream.aspx" rel="nofollow noreferrer">MSDN</a>.</p> <p>Here is the example from MSDN:</p> <pre><code> // Create a new HttpWebRequest object. HttpWebRequest request=(HttpWebRequest) WebRequest.Create("http://www.contoso.com/example.aspx"); // Set the ContentType property. request.ContentType="application/x-www-form-urlencoded"; // Set the Method property to 'POST' to post data to the URI. request.Method = "POST"; // Start the asynchronous operation. request.BeginGetRequestStream(new AsyncCallback(ReadCallback), request); // Keep the main thread from continuing while the asynchronous // operation completes. A real world application // could do something useful such as updating its user interface. allDone.WaitOne(); // Get the response. HttpWebResponse response = (HttpWebResponse)request.GetResponse(); Stream streamResponse = response.GetResponseStream(); StreamReader streamRead = new StreamReader(streamResponse); string responseString = streamRead.ReadToEnd(); Console.WriteLine(responseString); // Close the stream object. streamResponse.Close(); streamRead.Close(); // Release the HttpWebResponse. response.Close(); </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload