Giter VIP home page Giter VIP logo

better-xnet's Introduction

NOTE : This project is currently dead. If you want a more stable HTTP library, check out my other project named ReqDotNet.

Thanks everyone!

Thanks to everyone for starring my xNet fork, it was my biggest C# project back in the days. Now, I'm making other projects that interests me even more. You can fork my project if you want to keep it alive! :D

Better-xNet - a fork of the original xNet C# library, which includes all of these fixes & more :

Current version : 3.4.3

Changelog :

  • Optimized the HttpUtils's GetPageSource() and TestWebsite() functions.
  • Made some minor changes in the CookieStorage class and HttpRequest.Request() function (private).
  • Now using an improved version of the MemoryStream class called MemoryTributary and edited it to match xNet's needs. This version is used in the HttpResponse.ToString() method.
  • Also made some minor changes in the ProxyHelper and ProxyClient.

Donation :

Is this library useful to you? If yes, then you should consider donating me (even a little) so I can get myself a cup of coffee! PayPal : [email protected] - Bitcoin : 1Q8dZDTDxzJ1YLbm4fYfEK8KvDq86LFucU

Also check out my YouTube channel!

Example (updated for the version 3.4.2) :

using (HttpRequest req = new HttpRequest())
{
   req.UserAgent = Http.PaleMoonUserAgent(); // Basically this is what browser you will choose to make your request
   req.Proxy = Socks4ProxyClient.Parse("177.10.144.22:1080"); // Not needed here but it's an example
   req.KeepAlive = true; // Sometimes useful
   req.Cookies = new CookieStorage(); // Same as the proxy
   // Note that req.CheckBadStatusCode is already false by default.

   req.Send(HttpMethod.GET, new Uri("https://httpbin.org/get")).ToString(); // Sending a GET request without any parameters
   // Also note that the example above doesn't contain any HttpContent because we don't need any.
   
   // DEPRECATED USE OF THE PARAMETERS IN A REQUEST, NEEDS TO BE UPDATED :
   req.AddParam("email", "[email protected]");
   req.AddParam("password", "c0ns1d3rD0nat1ngM3!");

   req.Send(HttpMethod.POST, new Uri("https://httpbin.org/post")).ToString(); // Sending a POST request with parameters "email" and "password".
   
   // Updated use of the parameters in a request :
   // -- Normal :
   req.Send(HttpMethod.POST, new Uri("https://httpbin.org/post"), new BytesContent(Encoding.UTF8.GetBytes("[email protected]&password=c0ns1d3rD0nat1ngM3!")).ToString();
   
   // -- JSON :
   req.Send(HttpMethod.POST, new Uri("https://httpbin.org/post"), new BytesContent(Encoding.UTF8.GetBytes("{\"email\":\"[email protected]\",\"password\":\"c0ns1d3rD0nat1ngM3!\"}"))).ToString()
}

better-xnet's People

Contributors

anerruption avatar c3ffee avatar geograph-us avatar rusildo avatar x-rus avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

better-xnet's Issues

Nuget Package

could you send me the link to nuget or the DLL link i want to test this version of xNet

Contact?

Salut, es-ce possible de t'ajouter sur Discord pour discuter ? Mon discord: qzq#2152

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.