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 539861c commit 49a2c0fCopy full SHA for 49a2c0f
test/Exceptionless.Tests/Platforms/AspNetCoreRequestInfoTests.cs
@@ -68,9 +68,13 @@ private static DefaultHttpContext CreateHttpContext(string body) {
68
}
69
70
private static DefaultHttpContext CreateFormHttpContext() {
71
+ const string formBody = "name=world";
72
+ var bodyBytes = Encoding.UTF8.GetBytes(formBody);
73
var context = new DefaultHttpContext();
74
context.Request.Method = HttpMethods.Post;
75
context.Request.ContentType = "application/x-www-form-urlencoded";
76
+ context.Request.ContentLength = bodyBytes.Length;
77
+ context.Request.Body = new MemoryStream(bodyBytes);
78
context.Request.Form = new FormCollection(new Dictionary<string, StringValues> {
79
["name"] = "world"
80
});
0 commit comments