Skip to content

Commit 6a5759b

Browse files
wip
1 parent 9f107d2 commit 6a5759b

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
using Microsoft.AspNetCore.Mvc;
2+
3+
namespace Nullinside.Api.TwitchBot.Controllers;
4+
5+
public static class ControllerBaseExtensions {
6+
public static async Task<string> GetBodyAsString(this ControllerBase controller, CancellationToken token = new()) {
7+
using StreamReader stream = new StreamReader(controller.HttpContext.Request.Body);
8+
return await stream.ReadToEndAsync(token);
9+
}
10+
}

0 commit comments

Comments
 (0)