- tls 1.0
- tls 1.1
- tls 1.2
- tls 1.3
- SSL 3.0
- Http/s
- Socks4
- Socks4a
- Socks5
- Basic Authentication
- Digest Authentication
- Windows NT Challenge/Response authentication (ntlm)
- GET
- HEAD
- OPTIONS
- DELETE
- POST
- PUT
- PATCH
using MG.Net;
try
{
var hr = new HttpRequest();
var res = hr.Get("https://api.ipify.org?format=json");
if (res.IsOk)
{
Console.WriteLine(res.Content);
}
else
{
Console.WriteLine(res.StatusCode);
}
}
catch (HttpException ex)
{
Console.WriteLine(ex.Message);
}
StringContent content = new StringContent();
content.ContentType = "contenttype"; //Default is application/x-www-form-urlencoded
content["name1"] = "value1";
content["name2"] = "value2";
//Or
StringContent content = new StringContent("queryparams", "contenttype", encode);
MultipartContent content = new MultipartContent(); //Generate random boundary
//Or
MultipartContent content = new MultipartContent("boundary");
content.AddParam("name", "value");
content.AddParam("name", "filename", "contenttype");
StreamContent content = new StreamContent(stream); //Default ContentType is application/x-www-form-urlencoded
//Or
StreamContent content = new StreamContent(stream, contentType);
//Or
StreamContent content = new StreamContent(stream, contentType, size);
//ON
var hr = new HttpRequest()
{
AcceptAllCert = true
};
//OFF
var hr = new HttpRequest()
{
AcceptAllCert = false
};
ProxyClient pc = new ProxyClient(type, "host:port");
//Or
ProxyClient pc = new ProxyClient(type, "host", port);
//Or
ProxyClient pc = new ProxyClient(type, "host", port, "user", "pass");
var hr = new HttpRequest()
{
Proxy = pc
};
//Or
var hr = new HttpRequest()
{
Proxy = ProxyClient.Parse(type, "host:port");
};
ProxyClient pc = new ProxyClient(type, "host:port");
pc.ProxyAuthentication = ProxyAuthentication.Basic;
//Or
pc.ProxyAuthentication = ProxyAuthentication.Digest;
//Or
pc.ProxyAuthentication = ProxyAuthentication.Ntlm;
CookieDictionary cookie = new CookieDictionary();
cookie.Add("name1", "value1");
cookie.Add("name2", "value2");
var hr = new HttpRequest()
{
Cookies = cookie
};
//Or
var hr = new HttpRequest();
hr.Cookies.Add("name1", "value1");
hr.Cookies.Add("name2", "value2");
HeaderDictionary header = new HeaderDictionary();
header.Add("name1", "value1");
header.Add("name2", "value2");
var hr = new HttpRequest()
{
Headers = header
};
//Or
var hr = new HttpRequest();
hr.Headers.Add("name1", "value1");
hr.Headers.Add("name2", "value2");
string cookie = res.GetCookie("name");
string header = res.GetHeader("name");
MG.Net Based on Rebex.Net and all of you can use Rebex.Net directly from MG.Net.dll ...
this project code is old but releases is up to date Why? this project code just uploded to developers see how can use Rebex.Net an easy if you like build old code...
Tron or USDT : TNjbCfcg2mMokxnbWFkNJJRS8KpFEBxx9X