Accepting Raw Request Body Content in ASP.NET Core API Controllers

added by DotNetKicks
9/15/2017 12:11:54 PM

2 Kicks, 190 Views

When posting raw body content to ASP.NET Core the process is not very self-explanatory. There's no easy way to simply retrieve raw data to a parameter in an API method, so a few extra steps are provided using either manual handling of the raw request stream, or by creating custom formatter that can handle common 'raw' content types in your APIs via standard Controller method parameters.