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, 9:21 AM EDT
Nice share
Former memberPosted Feb 19, 2016, 8:54 PM EST
Nice one
Ehsan SajjadPosted Feb 18, 2016, 8:08 AM EST
Good one
Shubham KumarPosted Feb 17, 2016, 7:19 PM EST
nice
Sibeesh VenuTOP 100Posted Feb 17, 2016, 7:09 PM EST
Nice Share
Santhakumar MunuswamyPosted Feb 17, 2016, 5:25 PM EST
Thanks for nice share
Debendra DashPosted Feb 17, 2016, 8:31 AM EST
good one.....
Gowtham KTOP 100Posted Feb 17, 2016, 7:28 AM EST
Good One, Thanks for sharing
Sr KarthigaPosted Feb 17, 2016, 3:27 AM EST
Nice explanation
Pramod ThakurPosted Feb 17, 2016, 2:14 AM EST
nice share..