Skip to content

Zordon1337/LibHTTP

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Basic HTTP Library written in C#(.NET FRAMEWORK)

Example code screenshot

image

Example usage(Multiple addresses)

// Initalizing HTTP Server
HTTP http = new HTTP();
// Creating Thread so it will continue executing rest of the script(including http.GET)
Thread ServerThread = new Thread(() => http.ListenMA(new string[] { "http://127.0.0.1:80/", "http://localhost:80/" }));
// starting the thread
ServerThread.Start();
// adding paths and handlers to routes list
http.Get("/", "text/plain", queryparams => "pong");
// adding this to not close the whole server after initalizing
Console.ReadLine(); 

Example usage(Single address)

// Initalizing HTTP Server
HTTP http = new HTTP();
// Creating Thread so it will continue executing rest of the script(including http.GET)
Thread ServerThread = new Thread(() => http.Listen("http://localhost:80/"));
// starting the thread
ServerThread.Start();
// adding paths and handlers to routes list
http.Get("/", "text/plain", queryparams => "pong");
// adding this to not close the whole server after initalizing
Console.ReadLine(); 

More examples will be in wiki

Requirements

.NET Framework 4.7.2 or newer

About

Simple HTTP Library written in C#

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages