SpeedRequest will help you run requests quickly and smoothly.
- Paypal: trungd419@gmail.com - Nguyen Trung Duc
- VietTinBank: 104869915061 - Nguyen Trung Thanh
- MBBank: 9704229287539964 - Nguyen Trung Thanh
- ViettelPay: +84375724938 - Nguyen Trung Thanh
- Facebook: trungducmcgamer
- Instagram: trungducmcvn
- Github: trungducmcgamer
- Youtube: trungducmcgamer
- Discord: TrungDucMC_VN #2707
- Zalo: +84375724938
- E-Mail: trungd419@gmail.com
Installation via NuGet
Install-Package SpeedRequest
- GET
- POST
- PATCH
- DELETE
- PUT
- OPTIONS
- HEAD
- CONNECT
- TRACE
Add in the beggining of file.
using SpeedRequest;
And use one of this code templates:
SpeedRequest request = null;
try {
request = new SpeedRequest();
// Do something
}
catch (WebException ex) {
// Http error handling
}
catch (Exception ex) {
// Unhandled exceptions
}
Send multipart requests with fields and files:
var multipartContent = new MultipartContent();
multipartContent.AddString("login", "username");
multipartContent.AddString("password", "password");
multipartContent.AddFile(@"C:\hp.rar", "file1", "hp.rar");
string response = request.RequestUrl("https://example.com", Method.POST, "application/x-www-form-urlencoded", multipartContent);
Get page source:
string response = request.RequestUrl("https://example.com");
Post data:
string response = request.RequestUrl("https://example.com", Method.POST, "application/x-www-form-urlencoded", "login=username&password=password");
Get receive the message body of the response:
request.Requests().IgnoreProtocolErrors = true;
Add Headers:
request.Requests().AddHeaders("name", "value");
Add User-Agent:
request.Requests().UserAgent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.159 Safari/537.36";
Get response headers:
Headers[] headersResponse = request.Responses().HeadersResponse;
foreach (Headers headers in headersResponse)
{
// concat your string or do what you want
Console.WriteLine($"{headers.Name}: {headers.Value}");
}
Download a file:
request.ToFile("C:\\myDownloadedFile.zip");
Get Cookies:
string response = request.RequestUrl("https://example.com");
Cookies[] cookieResponse = request.Responses().Cookies;
foreach (Cookies cookie in cookieResponse)
{
// concat your string or do what you want
Console.WriteLine($"{cookie.Name}: {cookie.Value}");
}
Set proxy server:
// Type: HTTP / HTTPS
request.Proxy = HttpProxyClient.Parse("127.0.0.1:8080");
// Type: Socks4
request.Proxy = Socks4ProxyClient.Parse("127.0.0.1:9000");
// Type: Socks4a
request.Proxy = Socks4aProxyClient.Parse("127.0.0.1:9000");
// Type: Socks5
request.Proxy = Socks5ProxyClient.Parse("127.0.0.1:9000");
// Type: Proxy Authentication
request.Proxy = HttpProxyAuthenticationClient.Parse("127.0.0.1", 8080, "username", "password");