SHARE
TWEET

Untitled

a guest Jun 25th, 2019 51 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. [HttpPost]
  2.  
  3.     public async Task<ActionResult<int>> Process()
  4.     {
  5.         string jsonString = await GetRequestBody();
  6.          ...
  7.     }
  8.  
  9.     private async Task<string> GetRequestBody()
  10.     {
  11.         string jsonString;
  12.         using (StreamReader reader = new StreamReader(Request.Body, Encoding.UTF8))
  13.         {
  14.             jsonString = await reader.ReadToEndAsync();
  15.         }
  16.  
  17.         return jsonString;
  18.     }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top