Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- [HttpPost]
- public async Task<ActionResult<int>> Process()
- {
- string jsonString = await GetRequestBody();
- ...
- }
- private async Task<string> GetRequestBody()
- {
- string jsonString;
- using (StreamReader reader = new StreamReader(Request.Body, Encoding.UTF8))
- {
- jsonString = await reader.ReadToEndAsync();
- }
- return jsonString;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement