Post: EzNetwork - Networking Lib [OPEN SRC]
02-12-2016, 11:36 AM #1
Sonoro
I like anteaters
(adsbygoogle = window.adsbygoogle || []).push({}); EzNetwork is a small library I created to do networking in my .NET apps since HttpWebRequests and such make your code look very untidy.
The project is open source so you can just clone it from the repository and work on it on your own.

Examples:

GET Request
    
void MyFunction()
{
EzClient myClient = new EzClient();
Response getResponse = myClient.GET("https://www.google.com");
string responseSrc = getResponse.Source;
}


POST Request
    
void MyFunction()
{
EzClient myClient = new EzClient();
PostRequestBuilder post = new PostRequestBuilder("name=john&last_name=doe");
Dictionary<string, string> additional = new Dictionary<string, string>
{
{"MyHeader", "MyHeaderValue" }
};
Response postResponse = myClient.Post("https://httpbin.org/post", post, additional);
string responseSrc = postResponse.Source;
}


To-do List:

  • Add async methods
  • Add support for multipart form data
  • Other cool stuff


There are a lot of extensions for EzNetwork that allow you to set default headers for your client and manage cookies easily.

Repository: You must login or register to view this content.
Download: You must login or register to view this content.
Last edited by Sonoro ; 02-16-2016 at 07:40 PM.

The following 5 users say thank you to Sonoro for this useful post:

John, Sloth, Toxic
02-12-2016, 11:37 AM #2
Toxic
former staff
Originally posted by xSonoro View Post
EzNetwork is a small library I created to do networking in my .NET apps since HttpWebRequests and such make your code look very untidy.
The project is open source so you can just clone it from the repository and work on it on your own.

Examples:

GET Request
    
void MyFunction()
{
EzClient myClient = new EzClient();
Response getResponse = myClient.GET("https://www.google.com");
string responseSrc = getResponse.Source;
}


POST Request
    
void MyFunction()
{
EzClient myClient = new EzClient();
PostRequestBuilder post = new PostRequestBuilder("name=john&last_name=doe");
Dictionary<string, string> additional = new Dictionary<string, string>
{
{"MyHeader", "MyHeaderValue" }
};
Response postResponse = myClient.Post("https://httpbin.org/post", post, additional);
string responseSrc = postResponse.Source;
}


There are a lot of extensions for EzNetwork that allow you to set default headers for your client and manage cookies easily.

Repository: You must login or register to view this content.
Download: You must login or register to view this content.


u stole dat from me Sal
anyways, sick haabibi :salll:
Last edited by Toxic ; 02-12-2016 at 10:11 PM.
02-12-2016, 11:37 AM #3
Sonoro
I like anteaters
Originally posted by Habibi
u stole dat from me Sal
anyways, sick haabibi :sall:



Thanks for the idea :salll:
Last edited by Sonoro ; 02-12-2016 at 11:39 AM.
02-13-2016, 05:26 AM #4
CyberNomadic
Web Developer
Has potential that is for sure.
But, those TODOs are a must lol!
02-16-2016, 05:51 PM #5
Sonoro
I like anteaters
A small issue that prevented POST data to format correctly was fixed.
Download the update from codeplex.
02-27-2016, 02:55 PM #6
D7VS
Haxor!
thanks for sharing

Copyright © 2024, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo