Introduction:
Wikipedia states:
Middleware is computer software that provides services to software applications beyond those available from the operating system. It can be described as "software glue". Middleware makes it easier for software developers to perform communication and input/output, so they can focus on the specific purpose of their application.
Middleware is the software that connects software components or enterprise applications. Middleware is the software layer that lies between the operating system and the applications on each side of a distributed computer network.
Typically, it supports complex, distributed business software applications.
Middleware includes Web servers, application servers, content management systems, and similar tools that support application development and delivery. It is especially integral to information technologies.
Conceptual View:

Typically middleware plays a vital role in the request and response designing. Middleware can modify your request and send it to the server. So in this article we will try to develop sample middleware and check how to Post, Get values.
Requirements:
usingMicrosoft.Owin;
Code Snippet for Sample Middleware
Middleware is computer software that provides services to software applications beyond those available from the operating system. It can be described as "software glue". Middleware makes it easier for software developers to perform communication and input/output, so they can focus on the specific purpose of their application.
Middleware is the software that connects software components or enterprise applications. Middleware is the software layer that lies between the operating system and the applications on each side of a distributed computer network.
Typically, it supports complex, distributed business software applications.
Middleware includes Web servers, application servers, content management systems, and similar tools that support application development and delivery. It is especially integral to information technologies.
Conceptual View:

Typically middleware plays a vital role in the request and response designing. Middleware can modify your request and send it to the server. So in this article we will try to develop sample middleware and check how to Post, Get values.
Requirements:
usingMicrosoft.Owin;
Code Snippet for Sample Middleware
- public class Middleware < TModelType > : OwinMiddlewarewhereTModelType: class, new()
- {
- public Middleware(OwinMiddleware next): base(next)
- {
- }
- public override Task Invoke(IOwinContext context)
- {
- return this.Next.Invoke(context);
- }
- }
- public void Configuration(IAppBuilder builder)
- {
- builder.Use < Middleware < RequestHandler >> ();
- // It act as Controller
- builder.Map("/Step1", config =>
- {
- config.Use((context, next) => context.Response.WriteAsync("Response Receive from your own middleware "));
- });
- }
- try
- {
- using(WebApp.Start < StartUpController > ("http://localhost:5888/"))
- {
- Console.WriteLine("Now you can start working on your OWN API");
- Console.ReadLine();
- }
- } catch (Exception ex)
- {
- Console.WriteLine(ex.Message.ToString());
- Console.Read();
- }

Now take a look for post.
Making an API Request to post operation with POSTMAN:

Break Point step IN.

Text Visualization for Request:

Code for Builder to use POST operations,
- // Post Operations
- builder.Use((context, next) =>
- {
- if (context.Request.Method == "POST")
- {
- var form = context.Get < RequestHandler > ("Body");
- // return context.Response.WriteAsync("Post Received :" + form.value);
- returncontext.Response.WriteAsync("Post Received :");
- }
- return next();
- });
References and for more information:
Read more articles on C# Programming:

Vivek KumarPosted Mar 23, 2016, 1:21 PM
Nice share
Former memberPosted Feb 20, 2016, 1:54 AM
Nice one
Ehsan SajjadPosted Feb 18, 2016, 1:08 PM
Good one
Shubham KumarPosted Feb 18, 2016, 12:19 AM
nice
Sibeesh VenuPosted Feb 18, 2016, 12:09 AM
Nice Share
Santhakumar MunuswamyPosted Feb 17, 2016, 10:25 PM
Thanks for nice share
Debendra DashPosted Feb 17, 2016, 1:31 PM
good one.....
Gowtham KPosted Feb 17, 2016, 12:28 PM
Good One, Thanks for sharing
Sr KarthigaPosted Feb 17, 2016, 8:27 AM
Nice explanation
Pramod ThakurPosted Feb 17, 2016, 7:14 AM
nice share..