Skip to content

Latest commit

History

18 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

WebAPIHelper

A C# Helper class for making web API's. This makes it extremely easy.

Example Usage:

Somewhere in your class:

privateWebAPIHelperHelper;privateasyncvoidHandleData(stringData,RequestTyperequestType,HttpListenerContextcontext){if(requestType==RequestType.POST){// Tip: Data will be in json format if the request was formurlencoded, otherwise it will be the raw data.// Send a 200 OK responseHelper.SendResponse(context,"OK",HttpStatusCode.OK);}}

Somewhere in your code when you want to start the web api:

Helper=newWebAPIHelper(HandleData,"test",8000);

This will host on http://{YOURIP}:8000/test/

YOURIP being either a domain proxied to your system/servers public IP, or direct. Note it wont have SSL. Do not use this for any sensitive information or authentication. For that, use something better.

Note it depends on the port being open.

About

A C# Helper class for making web API's. This makes it extremely easy.

Topics

Resources

Stars

2 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages