Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSHARP

simple http request c#

using System.Net;

var url = "http://webcode.me";

var request = WebRequest.Create(url);
request.Method = "GET";

using var webResponse = request.GetResponse();
using var webStream = webResponse.GetResponseStream();

using var reader = new StreamReader(webStream);
var data = reader.ReadToEnd();

Console.WriteLine(data);
Source by zetcode.com #
 
PREVIOUS NEXT
Tagged: #simple #http #request
ADD COMMENT
Topic
Name
8+9 =