We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9f107d2 commit 6a5759bCopy full SHA for 6a5759b
src/Nullinside.Api.TwitchBot/Controllers/ControllerBaseExtensions.cs
@@ -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