Best and Recommended ASP.NET 1.1 Hosting Tutorial – How to Using ASP.NET Core’s middleware to modify response body


Notice: A non well formed numeric value encountered in C:\ClientSites\bestaspnethostingreview.com\httpdocs\wp-content\plugins\crayon-syntax-highlighter\crayon_formatter.class.php on line 118

Notice: A non well formed numeric value encountered in C:\ClientSites\bestaspnethostingreview.com\httpdocs\wp-content\plugins\crayon-syntax-highlighter\crayon_formatter.class.php on line 119

Notice: A non well formed numeric value encountered in C:\ClientSites\bestaspnethostingreview.com\httpdocs\wp-content\plugins\crayon-syntax-highlighter\crayon_formatter.class.php on line 118

Notice: A non well formed numeric value encountered in C:\ClientSites\bestaspnethostingreview.com\httpdocs\wp-content\plugins\crayon-syntax-highlighter\crayon_formatter.class.php on line 119

Notice: A non well formed numeric value encountered in C:\ClientSites\bestaspnethostingreview.com\httpdocs\wp-content\plugins\crayon-syntax-highlighter\crayon_formatter.class.php on line 118

Notice: A non well formed numeric value encountered in C:\ClientSites\bestaspnethostingreview.com\httpdocs\wp-content\plugins\crayon-syntax-highlighter\crayon_formatter.class.php on line 119

Notice: A non well formed numeric value encountered in C:\ClientSites\bestaspnethostingreview.com\httpdocs\wp-content\plugins\crayon-syntax-highlighter\crayon_formatter.class.php on line 118

Notice: A non well formed numeric value encountered in C:\ClientSites\bestaspnethostingreview.com\httpdocs\wp-content\plugins\crayon-syntax-highlighter\crayon_formatter.class.php on line 119

Note: the issue referenced in this post has been fixed and will get released with ASP.NET Core 1.1.

BestASPNETHostingReview.com | Best and cheap ASP.NET Core 1.1 Hosting. In this post I will explain you to using ASP.NET Core’s middleware to modify response body. While creating a small piece of middleware to modify the response body’s content, sometimes we  had trouble getting anything to appear in my browser. I would get a 200 response-code, but no content (i.e. Content-Length: 0). Here is an example that creates a similar setup:

vector people programing develop web site and application

Startup.cs

[su_button url=”http://asphostportal.com/ASPNET-1-Hosting.aspx” style=”stroked” background=”#eab912″ size=”4″]Best and Recommended ASP.NET Core 1.1 Hosting Click Here !![/su_button]

Initial response

Turns out this is a known issue and has an easy workaround which involves storing the original response stream and setting back to it after the middlewares are called:

Updated Startup.cs

New response

I hope this article helpful for you, happy coding 🙂