1254 references to WriteAsync
AutobahnTestApp (1)
Startup.cs (1)
33await context.Response.WriteAsync($"Ready to accept a WebSocket request at: {wsUrl}");
AzureAppServicesHostingStartupSample (24)
Startup.cs (24)
17await context.Response.WriteAsync("Hello World - " + DateTimeOffset.Now + Environment.NewLine); 18await context.Response.WriteAsync(Environment.NewLine); 20await context.Response.WriteAsync("Address:" + Environment.NewLine); 21await context.Response.WriteAsync("Scheme: " + context.Request.Scheme + Environment.NewLine); 22await context.Response.WriteAsync("Host: " + context.Request.Headers.Host + Environment.NewLine); 23await context.Response.WriteAsync("PathBase: " + context.Request.PathBase.Value + Environment.NewLine); 24await context.Response.WriteAsync("Path: " + context.Request.Path.Value + Environment.NewLine); 25await context.Response.WriteAsync("Query: " + context.Request.QueryString.Value + Environment.NewLine); 26await context.Response.WriteAsync(Environment.NewLine); 28await context.Response.WriteAsync("Connection:" + Environment.NewLine); 29await context.Response.WriteAsync("RemoteIp: " + context.Connection.RemoteIpAddress + Environment.NewLine); 30await context.Response.WriteAsync("RemotePort: " + context.Connection.RemotePort + Environment.NewLine); 31await context.Response.WriteAsync("LocalIp: " + context.Connection.LocalIpAddress + Environment.NewLine); 32await context.Response.WriteAsync("LocalPort: " + context.Connection.LocalPort + Environment.NewLine); 33await context.Response.WriteAsync("ClientCert: " + context.Connection.ClientCertificate + Environment.NewLine); 34await context.Response.WriteAsync(Environment.NewLine); 36await context.Response.WriteAsync("User: " + context.User.Identity.Name + Environment.NewLine); 37await context.Response.WriteAsync(Environment.NewLine); 39await context.Response.WriteAsync("Headers:" + Environment.NewLine); 42await context.Response.WriteAsync(header.Key + ": " + header.Value + Environment.NewLine); 44await context.Response.WriteAsync(Environment.NewLine); 46await context.Response.WriteAsync("Environment Variables:" + Environment.NewLine); 51await context.Response.WriteAsync(key + ": " + value + Environment.NewLine); 53await context.Response.WriteAsync(Environment.NewLine);
AzureAppServicesSample (24)
Startup.cs (24)
28await context.Response.WriteAsync("Hello World - " + DateTimeOffset.Now + Environment.NewLine); 29await context.Response.WriteAsync(Environment.NewLine); 31await context.Response.WriteAsync("Address:" + Environment.NewLine); 32await context.Response.WriteAsync("Scheme: " + context.Request.Scheme + Environment.NewLine); 33await context.Response.WriteAsync("Host: " + context.Request.Headers.Host + Environment.NewLine); 34await context.Response.WriteAsync("PathBase: " + context.Request.PathBase.Value + Environment.NewLine); 35await context.Response.WriteAsync("Path: " + context.Request.Path.Value + Environment.NewLine); 36await context.Response.WriteAsync("Query: " + context.Request.QueryString.Value + Environment.NewLine); 37await context.Response.WriteAsync(Environment.NewLine); 39await context.Response.WriteAsync("Connection:" + Environment.NewLine); 40await context.Response.WriteAsync("RemoteIp: " + context.Connection.RemoteIpAddress + Environment.NewLine); 41await context.Response.WriteAsync("RemotePort: " + context.Connection.RemotePort + Environment.NewLine); 42await context.Response.WriteAsync("LocalIp: " + context.Connection.LocalIpAddress + Environment.NewLine); 43await context.Response.WriteAsync("LocalPort: " + context.Connection.LocalPort + Environment.NewLine); 44await context.Response.WriteAsync("ClientCert: " + context.Connection.ClientCertificate + Environment.NewLine); 45await context.Response.WriteAsync(Environment.NewLine); 47await context.Response.WriteAsync("User: " + context.User.Identity.Name + Environment.NewLine); 48await context.Response.WriteAsync(Environment.NewLine); 50await context.Response.WriteAsync("Headers:" + Environment.NewLine); 53await context.Response.WriteAsync(header.Key + ": " + header.Value + Environment.NewLine); 55await context.Response.WriteAsync(Environment.NewLine); 57await context.Response.WriteAsync("Environment Variables:" + Environment.NewLine); 62await context.Response.WriteAsync(key + ": " + value + Environment.NewLine); 64await context.Response.WriteAsync(Environment.NewLine);
BasicLinkedApp (1)
Startup.cs (1)
28return context.Response.WriteAsync("Hello World");
BasicWebSite (4)
Controllers\TempDataController.cs (1)
67await Response.WriteAsync("Steve!");
Formatters\CustomFormatter.cs (1)
38await response.WriteAsync(context.Object.ToString());
Formatters\PlainTextFormatter.cs (1)
36await response.WriteAsync(context.Object as string);
StoreIntoTempDataActionResult.cs (1)
19return httpContext.Response.WriteAsync($"Hello from {nameof(StoreIntoTempDataActionResult)}");
Binding.Http.IntegrationTests (1)
MtomBindingTestHelper.cs (1)
59await context.Response.WriteAsync("--uuid:fca834ef-6b4a-43c0-a7d0-09064d2827e8+id=1\r\nContent-ID: <http://tempuri.org/0>\r\nContent-Transfer-Encoding: 8bit\r\nContent-Type: application/xop+xml;charset=utf-8;type=\"text/xml\"\r\n\r\n<s:Envelope xmlns:s=\"http://schemas.xmlsoap.org/soap/envelope/\"><s:Body><UploadStreamResponse xmlns=\"http://tempuri.org/\"></UploadStreamResponse></s:Body></s:Envelope>");
blazor-devserver (1)
Server\Startup.cs (1)
100return context.Response.WriteAsync($"The server is configured only to " +
Certificate.Optional.Sample (2)
Startup.cs (2)
49return context.Response.WriteAsync($"Hello {context.User.Identity.Name} at {context.Request.Host}"); 54return context.Response.WriteAsync($"Hello {context.User.Identity.Name} at {context.Request.Host}. Try /auth");
Certificate.Sample (1)
Startup.cs (1)
54return context.Response.WriteAsync($"Hello {context.User.Identity.Name}");
ConcurrencyLimiterSample (1)
Startup.cs (1)
26await context.Response.WriteAsync("Hello World!");
CookiePolicySample (25)
Startup.cs (25)
82await response.WriteAsync("<html><body>\r\n"); 84await response.WriteAsync($"<a href=\"{context.Request.PathBase}/\">Home</a><br>\r\n"); 85await response.WriteAsync($"<a href=\"{context.Request.PathBase}/Login\">Login</a><br>\r\n"); 86await response.WriteAsync($"<a href=\"{context.Request.PathBase}/Logout\">Logout</a><br>\r\n"); 87await response.WriteAsync($"<a href=\"{context.Request.PathBase}/CreateTempCookie\">Create Temp Cookie</a><br>\r\n"); 88await response.WriteAsync($"<a href=\"{context.Request.PathBase}/RemoveTempCookie\">Remove Temp Cookie</a><br>\r\n"); 89await response.WriteAsync($"<a href=\"{context.Request.PathBase}/CreateEssentialCookie\">Create Essential Cookie</a><br>\r\n"); 90await response.WriteAsync($"<a href=\"{context.Request.PathBase}/RemoveEssentialCookie\">Remove Essential Cookie</a><br>\r\n"); 91await response.WriteAsync($"<a href=\"{context.Request.PathBase}/GrantConsent\">Grant Consent</a><br>\r\n"); 92await response.WriteAsync($"<a href=\"{context.Request.PathBase}/WithdrawConsent\">Withdraw Consent</a><br>\r\n"); 93await response.WriteAsync("<br>\r\n"); 94await response.WriteAsync($"<a href=\"/NeedsConsent{context.Request.Path}\">Needs Consent</a><br>\r\n"); 95await response.WriteAsync($"<a href=\"/NeedsNoConsent{context.Request.Path}\">Needs No Consent</a><br>\r\n"); 96await response.WriteAsync("<br>\r\n"); 99await response.WriteAsync($"Consent: <br>\r\n"); 100await response.WriteAsync($" - IsNeeded: {feature.IsConsentNeeded} <br>\r\n"); 101await response.WriteAsync($" - Has: {feature.HasConsent} <br>\r\n"); 102await response.WriteAsync($" - Can Track: {feature.CanTrack} <br>\r\n"); 103await response.WriteAsync("<br>\r\n"); 105await response.WriteAsync($"{cookies.Count} Request Cookies:<br>\r\n"); 108await response.WriteAsync($" - {cookie.Key} = {cookie.Value} <br>\r\n"); 110await response.WriteAsync("<br>\r\n"); 113await response.WriteAsync($"{responseCookies.Count} Response Cookies:<br>\r\n"); 116await response.WriteAsync($" - {cookie} <br>\r\n"); 119await response.WriteAsync("</body></html>");
CookieSample (4)
Program.cs (4)
47await context.Response.WriteAsync("Hello First timer"); 52await context.Response.WriteAsync("Hello old timer"); 60await context.Response.WriteAsync($"Signed Out"); 66await context.Response.WriteAsync($"{key}: {value}\r\n");
CookieSessionSample (2)
Startup.cs (2)
46await context.Response.WriteAsync("Hello First timer"); 51await context.Response.WriteAsync("Hello old timer");
CreateDefaultBuilderApp (1)
Program.cs (1)
34return context.Response.WriteAsync(responseMessage ?? hostingEnvironment.ApplicationName);
CreateDefaultBuilderOfTApp (1)
Program.cs (1)
45return context.Response.WriteAsync(responseMessage ?? hostingEnvironment.ApplicationName);
CustomAuthorizationFailureResponse (2)
Authorization\SampleAuthorizationMiddlewareResultHandler.cs (2)
36await httpContext.Response.WriteAsync(policyAuthorizationResult.AuthorizationFailure.FailureReasons.First().Message); 46await httpContext.Response.WriteAsync(Startup.CustomForbiddenMessage);
DefaultBuilder.SampleApp (25)
Program.cs (7)
22using (WebHost.Start(context => context.Response.WriteAsync("Hello, World!"))) 33using (WebHost.Start("http://localhost:8080", context => context.Response.WriteAsync("Hello, World!"))) 45.MapGet("hello/{name}", (req, res, data) => res.WriteAsync($"Hello, {data.Values["name"]}")) 46.MapGet("goodbye/{name}", (req, res, data) => res.WriteAsync($"Goodbye, {data.Values["name"]}")) 48.MapGet("{greeting}/{name}", (req, res, data) => res.WriteAsync($"{data.Values["greeting"]}, {data.Values["name"]}")) 49.MapGet("", (req, res, data) => res.WriteAsync($"Hello, World!")))) 65await context.Response.WriteAsync("Hello, World!");
Startup.cs (18)
19await context.Response.WriteAsync($"Hello from {context.Request.GetDisplayUrl()}\r\n"); 20await context.Response.WriteAsync("\r\n"); 22await context.Response.WriteAsync("Headers:\r\n"); 25await context.Response.WriteAsync($"{header.Key}: {header.Value}\r\n"); 27await context.Response.WriteAsync("\r\n"); 29await context.Response.WriteAsync("Connection:\r\n"); 30await context.Response.WriteAsync("RemoteIp: " + context.Connection.RemoteIpAddress + "\r\n"); 31await context.Response.WriteAsync("RemotePort: " + context.Connection.RemotePort + "\r\n"); 32await context.Response.WriteAsync("LocalIp: " + context.Connection.LocalIpAddress + "\r\n"); 33await context.Response.WriteAsync("LocalPort: " + context.Connection.LocalPort + "\r\n"); 34await context.Response.WriteAsync("ClientCert: " + context.Connection.ClientCertificate + "\r\n"); 35await context.Response.WriteAsync("\r\n"); 37await context.Response.WriteAsync("Environment Variables:\r\n"); 42await context.Response.WriteAsync($"{key}: {value}\r\n"); 44await context.Response.WriteAsync("\r\n"); 46await context.Response.WriteAsync("Config:\r\n"); 48await context.Response.WriteAsync("\r\n"); 56await response.WriteAsync($"{pair.Path}: {pair.Value}\r\n");
DelegationSite (1)
Program.cs (1)
21return context.Response.WriteAsync("Hello from delegatee");
DependencyInjectionApp (2)
Program.cs (2)
31return context.Response.WriteAsync("Success"); 35return context.Response.WriteAsync(ex.ToString());
Diagnostics.EFCore.FunctionalTests (3)
DatabaseErrorPageMiddlewareTest.cs (2)
57await context.Response.WriteAsync("Request Handled"); 322await context.Response.WriteAsync("Saved a Blog");
MigrationsEndPointMiddlewareTest.cs (1)
54await context.Response.WriteAsync("Request Handled");
ExceptionHandlerSample (14)
Startup.cs (9)
21await context.Response.WriteAsync("<html><body>\r\n"); 22await context.Response.WriteAsync("We're sorry, we encountered an un-expected issue with your application.<br>\r\n"); 28await context.Response.WriteAsync("<br>Error: " + HtmlEncoder.Default.Encode(error.Error.Message) + "<br>\r\n"); 30await context.Response.WriteAsync("<br><a href=\"/\">Home</a><br>\r\n"); 31await context.Response.WriteAsync("</body></html>\r\n"); 32await context.Response.WriteAsync(new string(' ', 512)); // Padding for IE 51await context.Response.WriteAsync("<html><body>Welcome to the sample<br><br>\r\n"); 52await context.Response.WriteAsync("Click here to throw an exception: <a href=\"/throw\">throw</a>\r\n"); 53await context.Response.WriteAsync("</body></html>\r\n");
StartupWithProblemDetails.cs (4)
49await context.Response.WriteAsync("<html><body>Welcome to the sample<br><br>\r\n"); 50await context.Response.WriteAsync("Click here to throw an exception: <a href=\"/throw\">throw</a><br>\r\n"); 51await context.Response.WriteAsync("Click here to throw a conflict exception: <a href=\"/throw2/conflict\">throw conflict</a>\r\n"); 52await context.Response.WriteAsync("</body></html>\r\n");
StartupWithWebSocket.cs (1)
38await context.Response.WriteAsync($"Not a web socket request. PID: {Process.GetCurrentProcess().Id}");
GenericWebHost (1)
Program.cs (1)
23await context.Response.WriteAsync("Hello World!");
HeaderPropagationSample (6)
Startup.cs (6)
67await context.Response.WriteAsync($"'/' Got Header '{header.Key}': {string.Join(", ", (string[])header.Value)}\r\n"); 73await context.Response.WriteAsync("Sending request to /forwarded\r\n"); 81await context.Response.WriteAsync($"Sent Header '{header.Key}': {string.Join(", ", header.Value)}\r\n"); 84await context.Response.WriteAsync("Got response\r\n"); 85await context.Response.WriteAsync(await response.Content.ReadAsStringAsync()); 93await context.Response.WriteAsync($"'/forwarded' Got Header '{header.Key}': {string.Join(", ", (string[])header.Value)}\r\n");
HealthChecksSample (17)
BasicStartup.cs (1)
29await context.Response.WriteAsync("Go to /health to see the health status");
CustomWriterStartup.cs (2)
37await context.Response.WriteAsync("Go to /health to see the health status"); 52return httpContext.Response.WriteAsync(json.ToString(Formatting.Indented));
DbContextHealthStartup.cs (9)
50await context.Response.WriteAsync("Creating the database...\n"); 56await context.Response.WriteAsync("Done\n"); 57await context.Response.WriteAsync("Go to /health to see the health status\n"); 62await context.Response.WriteAsync("Deleting the database...\n"); 68await context.Response.WriteAsync("Done\n"); 69await context.Response.WriteAsync("Go to /health to see the health status\n"); 74await context.Response.WriteAsync("Go to /health to see the health status\n"); 75await context.Response.WriteAsync("Go to /createdatabase to create the database\n"); 76await context.Response.WriteAsync("Go to /deletedatabase to delete the database\n");
DBHealthStartup.cs (1)
38await context.Response.WriteAsync("Go to /health to see the health status");
LivenessProbeStartup.cs (3)
59await context.Response.WriteAsync("Go to /health/ready to see the readiness status"); 60await context.Response.WriteAsync(Environment.NewLine); 61await context.Response.WriteAsync("Go to /health/live to see the liveness status");
ManagementPortStartup.cs (1)
40await context.Response.WriteAsync($"Go to http://localhost:{Configuration["ManagementPort"]}/health to see the health status");
HostFilteringSample (1)
Startup.cs (1)
46return context.Response.WriteAsync("Hello World! " + context.Request.Host);
HotAddSample (19)
Startup.cs (19)
43await context.Response.WriteAsync("<html><body>"); 47await context.Response.WriteAsync("Added: <a href=\"" + toAdd + "\">" + toAdd + "</a>"); 51await context.Response.WriteAsync("Error adding: " + toAdd + "<br>"); 52await context.Response.WriteAsync(ex.ToString().Replace(Environment.NewLine, "<br>")); 54await context.Response.WriteAsync("<br><a href=\"" + context.Request.PathBase.ToUriComponent() + "\">back</a>"); 55await context.Response.WriteAsync("</body></html>"); 69await context.Response.WriteAsync("<html><body>"); 72await context.Response.WriteAsync("Removed: " + toRemove); 76await context.Response.WriteAsync("Not found: " + toRemove); 78await context.Response.WriteAsync("<br><a href=\"" + context.Request.PathBase.ToUriComponent() + "\">back</a>"); 79await context.Response.WriteAsync("</body></html>"); 88await context.Response.WriteAsync("<html><body>"); 89await context.Response.WriteAsync("Listening on these prefixes: <br>"); 92await context.Response.WriteAsync("<a href=\"" + prefix + "\">" + prefix + "</a> <a href=\"?remove=" + prefix + "\">(remove)</a><br>"); 95await context.Response.WriteAsync("<form action=\"" + context.Request.PathBase.ToUriComponent() + "\" method=\"GET\">"); 96await context.Response.WriteAsync("<input type=\"text\" name=\"add\" value=\"http://localhost:12348\" >"); 97await context.Response.WriteAsync("<input type=\"submit\" value=\"Add\">"); 98await context.Response.WriteAsync("</form>"); 100await context.Response.WriteAsync("</body></html>");
Http2SampleApp (1)
Startup.cs (1)
23return context.Response.WriteAsync("Hello World! " + context.Request.Protocol);
Http3SampleApp (1)
Startup.cs (1)
26await context.Response.WriteAsync($"Hello World! {context.Request.Protocol} {context.Connection.ClientCertificate?.Subject}");
HttpLogging.Sample (1)
Startup.cs (1)
31await context.Response.WriteAsync("Hello World!");
HttpOverridesSample (5)
Startup.cs (5)
23await context.Response.WriteAsync($"{header.Key}: {header.Value}\r\n"); 25await context.Response.WriteAsync($"Method: {context.Request.Method}\r\n"); 26await context.Response.WriteAsync($"Scheme: {context.Request.Scheme}\r\n"); 27await context.Response.WriteAsync($"RemoteIP: {context.Connection.RemoteIpAddress}\r\n"); 28await context.Response.WriteAsync($"RemotePort: {context.Connection.RemotePort}\r\n");
HttpsPolicySample (1)
Startup.cs (1)
38await context.Response.WriteAsync("Hello world!");
HttpStress (5)
Program.cs (5)
425await context.Response.WriteAsync(contentSource); 432await context.Response.WriteAsync(contentSource[i].ToString()); 445await context.Response.WriteAsync(contentSource); 459await context.Response.WriteAsync(contentSource.Substring(0, contentSource.Length / 2)); 465var writeTask = context.Response.WriteAsync(contentSource.Substring(0, contentSource.Length));
IIS.Tests (3)
ResponseAbortTests.cs (1)
44await ctx.Response.WriteAsync("Abort");
TestServerTest.cs (1)
27return ctx.Response.WriteAsync(helloWorld);
Utilities\TestServer.cs (1)
154app.Map("/start", builder => builder.Run(context => context.Response.WriteAsync("Done")));
IISSample (27)
Startup.cs (27)
42await context.Response.WriteAsync("Hello World - " + DateTimeOffset.Now + Environment.NewLine); 43await context.Response.WriteAsync(Environment.NewLine); 45await context.Response.WriteAsync("Address:" + Environment.NewLine); 46await context.Response.WriteAsync("Scheme: " + context.Request.Scheme + Environment.NewLine); 47await context.Response.WriteAsync("Host: " + context.Request.Headers["Host"] + Environment.NewLine); 48await context.Response.WriteAsync("PathBase: " + context.Request.PathBase.Value + Environment.NewLine); 49await context.Response.WriteAsync("Path: " + context.Request.Path.Value + Environment.NewLine); 50await context.Response.WriteAsync("Query: " + context.Request.QueryString.Value + Environment.NewLine); 51await context.Response.WriteAsync(Environment.NewLine); 53await context.Response.WriteAsync("Connection:" + Environment.NewLine); 54await context.Response.WriteAsync("RemoteIp: " + context.Connection.RemoteIpAddress + Environment.NewLine); 55await context.Response.WriteAsync("RemotePort: " + context.Connection.RemotePort + Environment.NewLine); 56await context.Response.WriteAsync("LocalIp: " + context.Connection.LocalIpAddress + Environment.NewLine); 57await context.Response.WriteAsync("LocalPort: " + context.Connection.LocalPort + Environment.NewLine); 58await context.Response.WriteAsync("ClientCert: " + context.Connection.ClientCertificate + Environment.NewLine); 59await context.Response.WriteAsync(Environment.NewLine); 61await context.Response.WriteAsync("User: " + context.User.Identity.Name + Environment.NewLine); 63await context.Response.WriteAsync("DisplayName: " + scheme?.DisplayName + Environment.NewLine); 64await context.Response.WriteAsync(Environment.NewLine); 66await context.Response.WriteAsync("Headers:" + Environment.NewLine); 69await context.Response.WriteAsync(header.Key + ": " + header.Value + Environment.NewLine); 71await context.Response.WriteAsync(Environment.NewLine); 73await context.Response.WriteAsync("Environment Variables:" + Environment.NewLine); 78await context.Response.WriteAsync(key + ": " + value + Environment.NewLine); 81await context.Response.WriteAsync(Environment.NewLine); 84await context.Response.WriteAsync("Websocket feature is enabled."); 88await context.Response.WriteAsync("Websocket feature is disabled.");
InMemory.FunctionalTests (169)
ChunkedResponseTests.cs (12)
61await httpContext.Response.WriteAsync("Hello "); 62await httpContext.Response.WriteAsync("World!"); 125await httpContext.Response.WriteAsync("Hello "); 126await httpContext.Response.WriteAsync("World!"); 161await httpContext.Response.WriteAsync(expectedString); 281await httpContext.Response.WriteAsync("Hello "); 282await httpContext.Response.WriteAsync("World!"); 355await response.WriteAsync(""); 359await response.WriteAsync("Hello World!"); 928await response.WriteAsync("World!"); 966await response.WriteAsync("World!"); 1160await response.WriteAsync("hello, world");
ConnectionLimitTests.cs (2)
38await context.Response.WriteAsync("Hello"); 114await context.Response.WriteAsync("Hello");
ConnectionMiddlewareTests.cs (2)
278await context.Response.WriteAsync("Hello "); 280await context.Response.WriteAsync("World!");
Http2\Http2ConnectionTests.cs (2)
572await context.Response.WriteAsync("Content"); 1986await context.Response.WriteAsync(new string('!', 65536));
Http2\Http2EndToEndTests.cs (1)
38await context.Response.WriteAsync("hello, world");
Http2\Http2StreamTests.cs (46)
1336await context.Response.WriteAsync("hello, world"); // 12 1374await context.Response.WriteAsync("hello,"); 1375await context.Response.WriteAsync(" world"); 1596await context.Response.WriteAsync("hello, world"); 1680await context.Response.WriteAsync(""); 1716await context.Response.WriteAsync("hello, world"); 1827return context.Response.WriteAsync("hello,"); 2148await context.Response.WriteAsync("Hello World"); 2189await context.Response.WriteAsync("Hello World"); 2230await context.Response.WriteAsync("Hello World"); 2360await context.Response.WriteAsync("Hello World"); 2403await context.Response.WriteAsync("Hello World"); 2468await context.Response.WriteAsync("Hello World"); 2511await context.Response.WriteAsync("Hello World"); 2564await context.Response.WriteAsync("Hello World"); 2596await context.Response.WriteAsync("Hello World"); 2638await context.Response.WriteAsync("Hello World"); 2731await context.Response.WriteAsync("Hello World"); 2791await context.Response.WriteAsync("Hello World"); 2846await context.Response.WriteAsync("Hello World"); 3134await context.Response.WriteAsync("hello,"); 3530await context.Response.WriteAsync("Hello World"); 3567await context.Response.WriteAsync("Hello World"); 3605await context.Response.WriteAsync("Hello World"); 3655await context.Response.WriteAsync("Hello World"); 3684await context.Response.WriteAsync("Hello World"); 3717await context.Response.WriteAsync("Hello World"); 3756await context.Response.WriteAsync("Hello World"); 3796await Assert.ThrowsAsync<OperationCanceledException>(() => context.Response.WriteAsync("hello,", new CancellationToken(true))); 3831var writeTask = context.Response.WriteAsync("hello,", cts.Token); 4176await response.WriteAsync(" world"); 4387await response.WriteAsync("hello, world"); 4587await response.WriteAsync("hello, world"); 4671writeEx = await Assert.ThrowsAsync<InvalidOperationException>(() => context.Response.WriteAsync("")); 4919await context.Response.WriteAsync("Hello World"); 4990var ex = await Assert.ThrowsAsync<InvalidOperationException>(() => context.Response.WriteAsync("2 Hello World").DefaultTimeout()); 5041await context.Response.WriteAsync("Hello World").DefaultTimeout(); 5049var ex = await Assert.ThrowsAsync<InvalidOperationException>(() => context.Response.WriteAsync("2 Hello World").DefaultTimeout()); 5234await context.Response.WriteAsync("Hello World"); 5309await context.Response.WriteAsync("Hello World"); 5380await context.Response.WriteAsync("Hello World"); 5449await context.Response.WriteAsync("Hello World"); 5531await context.Response.WriteAsync("Hello World"); 5613await context.Response.WriteAsync("Hello World"); 5697await context.Response.WriteAsync("Hello World"); 5850await response.WriteAsync("hello, world");
Http2\TlsTests.cs (1)
47return context.Response.WriteAsync("hello world " + context.Request.Protocol);
Http3\Http3StreamTests.cs (19)
666await response.WriteAsync("Hello world"); 866await context.Response.WriteAsync("Hello World"); 900await context.Response.WriteAsync("Hello World"); 932await context.Response.WriteAsync("Hello World"); 959await context.Response.WriteAsync("Hello world"); 1012await context.Response.WriteAsync("Hello World"); 1043await context.Response.WriteAsync("Hello World"); 1082await context.Response.WriteAsync("Hello World"); 1287await context.Response.WriteAsync("Hello World"); 1345var ex = await Assert.ThrowsAsync<InvalidOperationException>(() => context.Response.WriteAsync("2 Hello World").DefaultTimeout()); 1389await context.Response.WriteAsync("Hello World").DefaultTimeout(); 1397var ex = await Assert.ThrowsAsync<InvalidOperationException>(() => context.Response.WriteAsync("2 Hello World").DefaultTimeout()); 1542await context.Response.WriteAsync("Hello World"); 1598await context.Response.WriteAsync("Hello World"); 1656await context.Response.WriteAsync("Hello World"); 1712await context.Response.WriteAsync("Hello World"); 1773await context.Response.WriteAsync("Hello World"); 1835await context.Response.WriteAsync("Hello World"); 1900await context.Response.WriteAsync("Hello World");
HttpsConnectionMiddlewareTests.cs (18)
118return context.Response.WriteAsync("hello world"); 157return context.Response.WriteAsync("hello world"); 193return context.Response.WriteAsync("hello world"); 235return context.Response.WriteAsync("hello world"); 263return context.Response.WriteAsync("hello world"); 516return context.Response.WriteAsync("hello world"); 558await context.Response.WriteAsync("hello world"); 602await context.Response.WriteAsync("hello world"); 645await context.Response.WriteAsync("hello world"); 686await context.Response.WriteAsync("hello world"); 734await context.Response.WriteAsync("hello world"); 776await context.Response.WriteAsync("hello world"); 843context => context.Response.WriteAsync("hello world"), 1042await context.Response.WriteAsync("hello world"); 1086await context.Response.WriteAsync("hello world"); 1118await using (var server = new TestServer(context => context.Response.WriteAsync(context.Request.Scheme), new TestServiceContext(LoggerFactory), ConfigureListenOptions)) 1141await using (var server = new TestServer(context => context.Response.WriteAsync("hello world"), new TestServiceContext(LoggerFactory), ConfigureListenOptions)) 1287return context.Response.WriteAsync("hello world");
HttpsTests.cs (2)
239await httpContext.Response.WriteAsync("hello, world", ct); 284await httpContext.Response.WriteAsync("hello, world");
KestrelMetricsTests.cs (2)
179await context.Response.WriteAsync("Hello World?"); 774context.Response.WriteAsync("Hello world");
LoggingConnectionMiddlewareTests.cs (1)
23return context.Response.WriteAsync("Hello World!");
MaxRequestBodySizeTests.cs (2)
85await context.Response.WriteAsync(customApplicationResponse); 132await context.Response.WriteAsync(customApplicationResponse);
MaxRequestLineSizeTests.cs (1)
85return new TestServer(async httpContext => await httpContext.Response.WriteAsync("hello, world"), new TestServiceContext(LoggerFactory, metrics: new KestrelMetrics(meterFactory))
RequestBodyTimeoutTests.cs (1)
186await context.Response.WriteAsync("hello, world");
RequestHeaderLimitsTests.cs (1)
176return new TestServer(async httpContext => await httpContext.Response.WriteAsync("hello, world"), new TestServiceContext(LoggerFactory, metrics: kestrelMetrics)
RequestHeadersTimeoutTests.cs (1)
161await httpContext.Response.WriteAsync("hello, world");
RequestTargetProcessingTests.cs (2)
27await context.Response.WriteAsync("Hello World"); 72await context.Response.WriteAsync("Hello World");
RequestTests.cs (14)
45await context.Response.WriteAsync("hello, world"); 69await context.Response.WriteAsync("hello, world"); 102await context.Response.WriteAsync("hello, world"); 140await context.Response.WriteAsync("Read success"); 145await context.Response.WriteAsync("Read cancelled"); 240await context.Response.WriteAsync("Done"); 338return context.Response.WriteAsync($"{value}"); 375return context.Response.WriteAsync($"{value}"); 409return context.Response.WriteAsync($"{value}"); 444await context.Response.WriteAsync($"{value}"); 485await context.Response.WriteAsync($"{value}"); 528await context.Response.WriteAsync($"{value}"); 578await context.Response.WriteAsync(context.TraceIdentifier); 596await context.Response.WriteAsync(context.TraceIdentifier);
ResponseHeaderTests.cs (4)
29return context.Response.WriteAsync("Hello World"); 60return context.Response.WriteAsync("Hello World"); 93return context.Response.WriteAsync("Hello World"); 122return context.Response.WriteAsync("Hello World");
ResponseTests.cs (35)
81await context.Response.WriteAsync("hello, world"); 156await context.Response.WriteAsync("hello", cts.Token).DefaultTimeout(); 378await context.Response.WriteAsync("hello, world"); 413await context.Response.WriteAsync("hello, world"); 520await httpContext.Response.WriteAsync("hello, "); 521await httpContext.Response.WriteAsync("world"); 800await httpContext.Response.WriteAsync("hello, world"); 842await httpContext.Response.WriteAsync("hello, world"); 915await httpContext.Response.WriteAsync(response); 1001await httpContext.Response.WriteAsync("hello,"); 1002await httpContext.Response.WriteAsync(" world"); 1118await httpContext.Response.WriteAsync("hello, world"); 1172await httpContext.Response.WriteAsync("hello, world"); 1226await httpContext.Response.WriteAsync("hello,"); 1348await httpContext.Response.WriteAsync("hello, world"); 1384await httpContext.Response.WriteAsync("hello, world"); 1441await httpContext.Response.WriteAsync("hello, world"); 1505await httpContext.Response.WriteAsync(""); 1507await httpContext.Response.WriteAsync("hello, world"); 1548await httpContext.Response.WriteAsync(ex.Message); 1580await httpContext.Response.WriteAsync("hello, world"); 1626await httpContext.Response.WriteAsync("hello, world"); 1673await httpContext.Response.WriteAsync("hello, world"); 1968await httpContext.Response.WriteAsync("hello, world"); 2156await httpContext.Response.WriteAsync("hello, world"); 2965await httpContext.Response.WriteAsync(""); 2992await httpContext.Response.WriteAsync(""); 3022await httpContext.Response.WriteAsync("Hello World!"); 3180await httpContext.Response.WriteAsync("Hello World"); 3210await httpContext.Response.WriteAsync(expectedString); 3336await context.Response.WriteAsync(response); 3387await context.Response.WriteAsync(response); 3788await response.WriteAsync("hello, world"); 3846writeEx = await Assert.ThrowsAsync<InvalidOperationException>(() => httpContext.Response.WriteAsync("test")); 3876await httpContext.Response.WriteAsync("hello, world");
InProcessWebSite (101)
src\Servers\IIS\IIS\test\testassets\InProcessWebSite\Program.cs (1)
100.Configure(builder => builder.Run(async context => { await context.Response.WriteAsync("I shouldn't work"); }))
src\Servers\IIS\IIS\test\testassets\InProcessWebSite\Startup.cs (100)
58private async Task ContentRootPath(HttpContext ctx) => await ctx.Response.WriteAsync(ctx.RequestServices.GetService<Microsoft.AspNetCore.Hosting.IHostingEnvironment>().ContentRootPath); 60private async Task WebRootPath(HttpContext ctx) => await ctx.Response.WriteAsync(ctx.RequestServices.GetService<Microsoft.AspNetCore.Hosting.IHostingEnvironment>().WebRootPath); 67private async Task CurrentDirectory(HttpContext ctx) => await ctx.Response.WriteAsync(Environment.CurrentDirectory); 69private async Task BaseDirectory(HttpContext ctx) => await ctx.Response.WriteAsync(AppContext.BaseDirectory); 75await ctx.Response.WriteAsync("IIS Version: " + config["IIS_VERSION"] + Environment.NewLine); 76await ctx.Response.WriteAsync("ApplicationId: " + config["IIS_APPLICATION_ID"] + Environment.NewLine); 77await ctx.Response.WriteAsync("Application Path: " + config["IIS_PHYSICAL_PATH"] + Environment.NewLine); 78await ctx.Response.WriteAsync("Application Virtual Path: " + config["IIS_APPLICATION_VIRTUAL_PATH"] + Environment.NewLine); 79await ctx.Response.WriteAsync("Application Config Path: " + config["IIS_APP_CONFIG_PATH"] + Environment.NewLine); 80await ctx.Response.WriteAsync("AppPool ID: " + config["IIS_APP_POOL_ID"] + Environment.NewLine); 81await ctx.Response.WriteAsync("AppPool Config File: " + config["IIS_APP_POOL_CONFIG_FILE"] + Environment.NewLine); 82await ctx.Response.WriteAsync("Site ID: " + config["IIS_SITE_ID"] + Environment.NewLine); 83await ctx.Response.WriteAsync("Site Name: " + config["IIS_SITE_NAME"]); 103private async Task ASPNETCORE_IIS_PHYSICAL_PATH(HttpContext ctx) => await ctx.Response.WriteAsync(Environment.GetEnvironmentVariable("ASPNETCORE_IIS_PHYSICAL_PATH")); 108await ctx.Response.WriteAsync(string.Join(",", serverAddresses.Addresses)); 113await ctx.Response.WriteAsync(ctx.Request.Protocol); 120await ctx.Response.WriteAsync("Hello World"); 127await ctx.Response.WriteAsync("Hello World"); 135await ctx.Response.WriteAsync(authScheme?.Name ?? "null"); 138await ctx.Response.WriteAsync(":" + ctx.User.Identity.Name); 145await context.Response.WriteAsync(clientCert != null ? $"Enabled;{clientCert.GetCertHashString()}" : "Disabled"); 172await context.Response.WriteAsync(_waitingRequestCount.ToString(CultureInfo.InvariantCulture)); 218await ctx.Response.WriteAsync(Environment.GetEnvironmentVariable(ctx.Request.Query["name"].ToString())); 230await ctx.Response.WriteAsync($"{varName}: {feature[varName] ?? "(null)"}"); 235await ctx.Response.WriteAsync("Anonymous?" + !ctx.User.Identity.IsAuthenticated); 242await ctx.Response.WriteAsync(ctx.User.Identity.AuthenticationType); 259await ctx.Response.WriteAsync("NTLM"); 269return ctx.Response.WriteAsync($"PathBase: {ctx.Request.PathBase.Value}; Path: {ctx.Request.Path.Value}"); 316await ctx.Response.WriteAsync("Success"); 322await ctx.Response.WriteAsync(exception.ToString()); 324await ctx.Response.WriteAsync("_Failure"); 352await ctx.Response.WriteAsync("Success"); 358await ctx.Response.WriteAsync(exception.ToString()); 360await ctx.Response.WriteAsync("_Failure"); 374await ctx.Response.WriteAsync("Success"); 380await ctx.Response.WriteAsync(exception.ToString()); 382await ctx.Response.WriteAsync("_Failure"); 397await ctx.Response.WriteAsync(ctx.Request.Query["body"]); 405await ctx.Response.WriteAsync(ctx.Request.Path.Value); 410await ctx.Response.WriteAsync(ctx.Request.QueryString.Value); 414await ctx.Response.WriteAsync("Hello World"); 421await ctx.Response.WriteAsync(new string('a', length)); 452await ctx.Response.WriteAsync("Request Complete"); 458await ctx.Response.WriteAsync("EmptyHeaderShouldBeSkipped"); 470return ctx.Response.WriteAsync($"Failure: '{headerName}' indexer"); 474return ctx.Response.WriteAsync($"Failure: '{headerName}' TryGetValue"); 498return ctx.Response.WriteAsync($"Failure: Repeated '{headerName}' Add did not throw"); 515return ctx.Response.WriteAsync("Success"); 522await ctx.Response.WriteAsync("Started_"); 529await ctx.Response.WriteAsync("SetStatusCodeAfterWriteThrew_"); 531await ctx.Response.WriteAsync("Finished"); 536await ctx.Response.WriteAsync("Started_"); 543await ctx.Response.WriteAsync("SetHeaderAfterWriteThrew_"); 545await ctx.Response.WriteAsync("Finished"); 587await ctx.Response.WriteAsync(_requestsInFlight.ToString(CultureInfo.InvariantCulture)); 592await ctx.Response.WriteAsync("done"); 598await ctx.Response.WriteAsync("test1"); 605await ctx.Response.WriteAsync("test2"); 615await ctx.Response.WriteAsync("Completed"); 622await ctx.Response.WriteAsync("hello world"); 635await ctx.Response.WriteAsync(Encoding.UTF8.GetString(readBuffer, 0, result)); 648await ctx.Response.WriteAsync(Encoding.UTF8.GetString(readBuffer, 0, result)); 675await ctx.Response.WriteAsync(line + Environment.NewLine); 707await ctx.Response.WriteAsync(line + Environment.NewLine); 731await ctx.Response.WriteAsync(value); 741await ctx.Response.WriteAsync(Encoding.UTF8.GetString(readBuffer, 0, result)); 743await ctx.Response.WriteAsync(Encoding.UTF8.GetString(readBuffer, 0, result)); 760await ctx.Response.WriteAsync("hello world"); 778await ctx.Response.WriteAsync(Encoding.UTF8.GetString(buffer)); 851await ctx.Response.WriteAsync(success ? "Success" : "Failure"); 875await ctx.Response.WriteAsync(count == 0 ? "Success" : "Failure"); 938await ctx.Response.WriteAsync(success ? "Success" : "Failure"); 952await ctx.Response.WriteAsync("Success"); 983await ctx.Response.WriteAsync(AppDomain.CurrentDomain.BaseDirectory); 989return ctx.Response.WriteAsync(ctx.Request.Path.Value); 994await ctx.Response.WriteAsync("Shutting down"); 1004await ctx.Response.WriteAsync("Shutting down"); 1011await ctx.Response.WriteAsync("Shutting down"); 1022await ctx.Response.WriteAsync("Hello World"); 1029await ctx.Response.WriteAsync("Hello World"); 1043await ctx.Response.WriteAsync(StartupHookCalled.ToString()); 1053await ctx.Response.WriteAsync("Response Begin"); 1056await ctx.Response.WriteAsync(serverVariableFeature["REMOTE_PORT"]); 1059await ctx.Response.WriteAsync("Response End"); 1064await ctx.Response.WriteAsync(string.Join("|", Environment.GetCommandLineArgs().Skip(1))); 1068ctx.Response.WriteAsync("Scheme:" + ctx.Request.Scheme + "; Original:" + ctx.Request.Headers["x-original-proto"]); 1070public Task Path(HttpContext ctx) => ctx.Response.WriteAsync(ctx.Request.Path.Value); 1072public Task Query(HttpContext ctx) => ctx.Response.WriteAsync(ctx.Request.QueryString.Value); 1074public Task BodyLimit(HttpContext ctx) => ctx.Response.WriteAsync(ctx.Features.Get<IHttpMaxRequestBodySizeFeature>()?.MaxRequestBodySize?.ToString(CultureInfo.InvariantCulture) ?? "null"); 1076public Task Anonymous(HttpContext context) => context.Response.WriteAsync("Anonymous?" + !context.User.Identity.IsAuthenticated); 1083return context.Response.WriteAsync(context.User.Identity.AuthenticationType); 1097return context.Response.WriteAsync("NTLM"); 1106context.Response.WriteAsync(context.Features.Get<IHttpUpgradeFeature>() != null ? "Enabled" : "Disabled"); 1120return context.Response.WriteAsync("Hello World"); 1123return context.Response.WriteAsync(context.Request.Headers["ANCMRHPath"]); 1128await context.Response.WriteAsync(Environment.ProcessId.ToString(CultureInfo.InvariantCulture)); 1135await context.Response.WriteAsync(httpsPort.HasValue ? httpsPort.Value.ToString(CultureInfo.InvariantCulture) : "NOVALUE"); 1142await context.Response.WriteAsync(httpsPort.HasValue ? httpsPort.Value.ToString(CultureInfo.InvariantCulture) : "NOVALUE"); 1173await ctx.Response.WriteAsync(exception.ToString()); 1194await ctx.Response.WriteAsync(exception.ToString());
Interop.FunctionalTests (30)
H2SpecTests.cs (1)
153await context.Response.WriteAsync("Hello World");
Http3\Http3RequestTests.cs (1)
140await context.Response.WriteAsync("hello, world");
Http3\Http3TlsTests.cs (8)
32await context.Response.WriteAsync("Hello World"); 83await context.Response.WriteAsync(hasCert.ToString()); 125await context.Response.WriteAsync(hasCert.ToString()); 170await context.Response.WriteAsync(hasCert.ToString()); 224await context.Response.WriteAsync(hasCert.ToString()); 265await context.Response.WriteAsync("Hello World"); 295await context.Response.WriteAsync("Hello World"); 448await context.Response.WriteAsync("Hello World");
HttpClientHttp2InteropTests.cs (20)
58.Configure(app => app.Run(context => context.Response.WriteAsync("Hello World"))); 411await context.Response.WriteAsync("Hello World"); 557await context.Response.WriteAsync("Hello "); 559await context.Response.WriteAsync("World"); 644await context.Response.WriteAsync("Hello World"); 672await context.Response.WriteAsync("Hello World"); 917await context.Response.WriteAsync("Hello World").DefaultTimeout(); 956await context.Response.WriteAsync("Hello World").DefaultTimeout(); 958await context.Response.WriteAsync("Hello World").DefaultTimeout(); 996await context.Response.WriteAsync("Hello World").DefaultTimeout(); 1320.Configure(app => app.Run(context => context.Response.WriteAsync("Hello World"))); 1353.Configure(app => app.Run(context => context.Response.WriteAsync("Hello World"))); 1424await context.Response.WriteAsync("Hello World"); 1469await context.Response.WriteAsync(oneKbString).DefaultTimeout(); 1471await context.Response.WriteAsync(new string('a', 1023)).DefaultTimeout(); 1508await context.Response.WriteAsync("Hello World"); 1559return context.Response.WriteAsync(context.Request.Host.Host); 1583.Configure(app => app.Run(context => context.Response.WriteAsync(context.Request.Path.Value))); 1622await context.Response.WriteAsync("Hello World"); 1667await context.Response.WriteAsync("Hello World");
JwtSample (1)
Startup.cs (1)
72return context.Response.WriteAsync(GenerateToken(context));
Kestrel.SampleApp (1)
Startup.cs (1)
63await context.Response.WriteAsync(response);
LocalizationSample (48)
Startup.cs (48)
47await context.Response.WriteAsync( 72await context.Response.WriteAsync($"<h1>{SR["Request Localization Sample"]}</h1>"); 73await context.Response.WriteAsync($"<h1>{SR["Hello"]}</h1>"); 74await context.Response.WriteAsync("<form id=\"theForm\" method=\"get\">"); 75await context.Response.WriteAsync($"<label for=\"culture\">{SR["Culture"]}: </label>"); 76await context.Response.WriteAsync("<select id=\"culture\" name=\"culture\">"); 78await context.Response.WriteAsync("</select><br />"); 79await context.Response.WriteAsync($"<label for=\"uiCulture\">{SR["UI Culture"]}: </label>"); 80await context.Response.WriteAsync("<select id=\"uiCulture\" name=\"ui-culture\">"); 82await context.Response.WriteAsync("</select><br />"); 83await context.Response.WriteAsync("<input type=\"submit\" value=\"go QS\" /> "); 84await context.Response.WriteAsync($"<input type=\"button\" value=\"go cookie\" onclick='useCookie();' /> "); 85await context.Response.WriteAsync($"<a href=\"/\" onclick='clearCookie();'>{SR["reset"]}</a>"); 86await context.Response.WriteAsync("</form>"); 87await context.Response.WriteAsync("<br />"); 88await context.Response.WriteAsync("<table><tbody>"); 89await context.Response.WriteAsync($"<tr><th>Winning provider:</th><td>{requestCultureFeature.Provider.GetType().Name}</td></tr>"); 90await context.Response.WriteAsync($"<tr><th>{SR["Current request culture:"]}</th><td>{requestCulture.Culture.DisplayName} ({requestCulture.Culture})</td></tr>"); 91await context.Response.WriteAsync($"<tr><th>{SR["Current request UI culture:"]}</th><td>{requestCulture.UICulture.DisplayName} ({requestCulture.UICulture})</td></tr>"); 92await context.Response.WriteAsync($"<tr><th>{SR["Current thread culture:"]}</th><td>{CultureInfo.CurrentCulture.DisplayName} ({CultureInfo.CurrentCulture})</td></tr>"); 93await context.Response.WriteAsync($"<tr><th>{SR["Current thread UI culture:"]}</th><td>{CultureInfo.CurrentUICulture.DisplayName} ({CultureInfo.CurrentUICulture})</td></tr>"); 94await context.Response.WriteAsync($"<tr><th>{SR["Current date (invariant full):"]}</th><td>{DateTime.Now.ToString("F", CultureInfo.InvariantCulture)}</td></tr>"); 95await context.Response.WriteAsync($"<tr><th>{SR["Current date (invariant):"]}</th><td>{DateTime.Now.ToString(CultureInfo.InvariantCulture)}</td></tr>"); 96await context.Response.WriteAsync($"<tr><th>{SR["Current date (request full):"]}</th><td>{DateTime.Now.ToString("F", CultureInfo.CurrentCulture)}</td></tr>"); 97await context.Response.WriteAsync($"<tr><th>{SR["Current date (request):"]}</th><td>{DateTime.Now.ToString(CultureInfo.CurrentCulture)}</td></tr>"); 98await context.Response.WriteAsync($"<tr><th>{SR["Current time (invariant):"]}</th><td>{DateTime.Now.ToString("T", CultureInfo.InvariantCulture)}</td></tr>"); 99await context.Response.WriteAsync($"<tr><th>{SR["Current time (request):"]}</th><td>{DateTime.Now.ToString("T", CultureInfo.CurrentCulture)}</td></tr>"); 100await context.Response.WriteAsync($"<tr><th>{SR["Big number (invariant):"]}</th><td>{(Math.Pow(2, 42) + 0.42).ToString("N", CultureInfo.InvariantCulture)}</td></tr>"); 101await context.Response.WriteAsync($"<tr><th>{SR["Big number (request):"]}</th><td>{(Math.Pow(2, 42) + 0.42).ToString("N", CultureInfo.CurrentCulture)}</td></tr>"); 102await context.Response.WriteAsync($"<tr><th>{SR["Big number negative (invariant):"]}</th><td>{(-Math.Pow(2, 42) + 0.42).ToString("N", CultureInfo.InvariantCulture)}</td></tr>"); 103await context.Response.WriteAsync($"<tr><th>{SR["Big number negative (request):"]}</th><td>{(-Math.Pow(2, 42) + 0.42).ToString("N", CultureInfo.CurrentCulture)}</td></tr>"); 104await context.Response.WriteAsync($"<tr><th>{SR["Money (invariant):"]}</th><td>{2199.50.ToString("C", CultureInfo.InvariantCulture)}</td></tr>"); 105await context.Response.WriteAsync($"<tr><th>{SR["Money (request):"]}</th><td>{2199.50.ToString("C", CultureInfo.CurrentCulture)}</td></tr>"); 106await context.Response.WriteAsync($"<tr><th>{SR["Money negative (invariant):"]}</th><td>{(-2199.50).ToString("C", CultureInfo.InvariantCulture)}</td></tr>"); 107await context.Response.WriteAsync($"<tr><th>{SR["Money negative (request):"]}</th><td>{(-2199.50).ToString("C", CultureInfo.CurrentCulture)}</td></tr>"); 108await context.Response.WriteAsync("</tbody></table>"); 109await context.Response.WriteAsync( 117await context.Response.WriteAsync($" <option value=\"\">-- select --</option>"); 118await context.Response.WriteAsync($" <option value=\"{new CultureInfo("en-US").Name}\">{new CultureInfo("en-US").DisplayName}</option>"); 119await context.Response.WriteAsync($" <option value=\"{new CultureInfo("en-AU").Name}\">{new CultureInfo("en-AU").DisplayName}</option>"); 120await context.Response.WriteAsync($" <option value=\"{new CultureInfo("en-GB").Name}\">{new CultureInfo("en-GB").DisplayName}</option>"); 121await context.Response.WriteAsync($" <option value=\"{new CultureInfo("fr-FR").Name}\">{new CultureInfo("fr-FR").DisplayName}</option>"); 122await context.Response.WriteAsync($" <option value=\"{new CultureInfo("es-ES").Name}\">{new CultureInfo("es-ES").DisplayName}</option>"); 123await context.Response.WriteAsync($" <option value=\"{new CultureInfo("ja-JP").Name}\">{new CultureInfo("ja-JP").DisplayName}</option>"); 124await context.Response.WriteAsync($" <option value=\"{new CultureInfo("zh").Name}\">{new CultureInfo("zh").DisplayName}</option>"); 125await context.Response.WriteAsync($" <option value=\"{new CultureInfo("zh-CN").Name}\">{new CultureInfo("zh-CN").DisplayName}</option>"); 126await context.Response.WriteAsync($" <option value=\"en-NOTREAL\">English (Not a real locale)</option>"); 127await context.Response.WriteAsync($" <option value=\"pp-NOTREAL\">Made-up (Not a real anything)</option>");
LocalizationWebsite (27)
StartupBuilderAPIs.cs (1)
34await context.Response.WriteAsync(customerStringLocalizer["Hello"]);
StartupContentLanguageHeader.cs (3)
39await context.Response.WriteAsync(hasContentLanguageHeader.ToString()); 40await context.Response.WriteAsync(" "); 41await context.Response.WriteAsync(contentLanguage);
StartupCustomCulturePreserved.cs (1)
34await context.Response.WriteAsync(10.ToString("C", CultureInfo.CurrentCulture));
StartupGetAllStrings.cs (3)
40await context.Response.WriteAsync(strings.Count().ToString(CultureInfo.InvariantCulture)); 41await context.Response.WriteAsync(" "); 42await context.Response.WriteAsync(string.Join(" ", strings));
StartupResourcesAtRootFolder.cs (5)
44await context.Response.WriteAsync(startupStringLocalizer["Hello"]); 45await context.Response.WriteAsync(" "); 46await context.Response.WriteAsync(stringLocalizer["Hello"]); 47await context.Response.WriteAsync(" "); 48await context.Response.WriteAsync(customerStringLocalizer["Hello"]);
StartupResourcesInClassLibrary.cs (7)
53await context.Response.WriteAsync(noAttributeNameStringLocalizer["Hello"]); 54await context.Response.WriteAsync(" "); 55await context.Response.WriteAsync(noAttributeStringLocalizer["Hello"]); 56await context.Response.WriteAsync(" "); 57await context.Response.WriteAsync(withAttributeNameStringLocalizer["Hello"]); 58await context.Response.WriteAsync(" "); 59await context.Response.WriteAsync(withAttributeStringLocalizer["Hello"]);
StartupResourcesInFolder.cs (7)
47await context.Response.WriteAsync(startupStringLocalizer["Hello"]); 48await context.Response.WriteAsync(" "); 49await context.Response.WriteAsync(stringLocalizer["Hello"]); 50await context.Response.WriteAsync(" "); 51await context.Response.WriteAsync(custromerStringLocalizer["Hello"]); 52await context.Response.WriteAsync(" "); 53await context.Response.WriteAsync(customCultureLocalizer["Hello"]);
Logging.W3C.Sample (1)
Startup.cs (1)
34await context.Response.WriteAsync("Hello World!");
Microsoft.AspNetCore.Authentication.Negotiate.Test (5)
EventTests.cs (1)
447await context.Response.WriteAsync(name);
NegotiateHandlerTests.cs (4)
275return context.Response.WriteAsync("Error Handler"); 432await context.Response.WriteAsync(name); 450await context.Response.WriteAsync(name); 459await context.Response.WriteAsync(name);
Microsoft.AspNetCore.Authentication.Test (34)
CertificateTests.cs (3)
830await response.WriteAsync("<claims>"); 833await response.WriteAsync($"<claim Type=\"{claim.Type}\" Issuer=\"{claim.Issuer}\">{claim.Value}</claim>"); 835await response.WriteAsync("</claims>");
CookieTests.cs (1)
1718await context.Response.WriteAsync("ha+1");
JwtBearerTests.cs (5)
209await context.Response.WriteAsync("i got this"); 854return context.Response.WriteAsync("You Shall Not Pass"); 879return context.Response.WriteAsync("You Shall Not Pass"); 1202await context.Response.WriteAsync(identifier.Value); 1207await context.Response.WriteAsync(token);
JwtBearerTests_Handler.cs (5)
196await context.Response.WriteAsync("i got this"); 800return context.Response.WriteAsync("You Shall Not Pass"); 824return context.Response.WriteAsync("You Shall Not Pass"); 1261await context.Response.WriteAsync(identifier.Value); 1266await context.Response.WriteAsync(token);
OpenIdConnect\OpenIdConnectAuthenticateTests.cs (2)
29await context.Response.WriteAsync("Hi from the callback path"); 54await context.Response.WriteAsync("Hi from the callback path");
OpenIdConnect\OpenIdConnectEventTests.cs (1)
28private readonly RequestDelegate AppWritePath = context => context.Response.WriteAsync(context.Request.Path);
OpenIdConnect\OpenIdConnectEventTests_Handler.cs (1)
28private readonly RequestDelegate AppWritePath = context => context.Response.WriteAsync(context.Request.Path);
WsFederation\WsFederationTest.cs (8)
386await context.Response.WriteAsync("Signing out..."); 390await context.Response.WriteAsync("SignedOut"); 399await context.Response.WriteAsync("AuthenticationFailed"); 407await context.Response.WriteAsync("signout-wsfed"); 425await context.Response.WriteAsync("Unauthorized"); 433await context.Response.WriteAsync("SignIn_Failed"); 437await context.Response.WriteAsync("Provider not invoked"); 442await context.Response.WriteAsync(WsFederationDefaults.AuthenticationScheme);
WsFederation\WsFederationTest_Handler.cs (8)
382await context.Response.WriteAsync("Signing out..."); 386await context.Response.WriteAsync("SignedOut"); 395await context.Response.WriteAsync("AuthenticationFailed"); 403await context.Response.WriteAsync("signout-wsfed"); 421await context.Response.WriteAsync("Unauthorized"); 429await context.Response.WriteAsync("SignIn_Failed"); 433await context.Response.WriteAsync("Provider not invoked"); 438await context.Response.WriteAsync(WsFederationDefaults.AuthenticationScheme);
Microsoft.AspNetCore.Components.Endpoints (3)
RazorComponentEndpointInvoker.cs (2)
179await context.Response.WriteAsync("The request has an incorrect Content-type."); 227await context.Response.WriteAsync("A valid antiforgery token was not provided with the request. Add an antiforgery token, or disable antiforgery validation for this endpoint.");
Rendering\EndpointHtmlRenderer.EventDispatch.cs (1)
73? _httpContext.Response.WriteAsync(detailedMessage)
Microsoft.AspNetCore.Components.WebAssembly.Server (9)
TargetPickerUi.cs (9)
126await context.Response.WriteAsync($@"WARNING: 198await context.Response.WriteAsync("WARNING: Open about:debugging tab before pressing Debugging Hotkey"); 279await context.Response.WriteAsync($@" 314await context.Response.WriteAsync("<h1>No inspectable pages found</h1>"); 319await context.Response.WriteAsync($"<p>The list of targets returned by {WebUtility.HtmlEncode(debuggerTabsListUrl)} contains no entries{suffix}.</p>"); 320await context.Response.WriteAsync("<p>Make sure your browser is displaying the target application.</p>"); 324await context.Response.WriteAsync("<h1>Inspectable pages</h1>"); 325await context.Response.WriteAsync(@" 357await context.Response.WriteAsync(
Microsoft.AspNetCore.CookiePolicy.Test (5)
CookieConsentTests.cs (4)
323await context.Response.WriteAsync("Started."); 333await context.Response.WriteAsync("Granted."); 473await context.Response.WriteAsync("Started."); 484await context.Response.WriteAsync("Withdrawn.");
CookiePolicyTests.cs (1)
342return context.Response.WriteAsync("Done");
Microsoft.AspNetCore.Cors.Test (9)
CorsMiddlewareTests.cs (9)
39await context.Response.WriteAsync("Cross origin response"); 81await context.Response.WriteAsync("Cross origin response"); 126await context.Response.WriteAsync("Cross origin response"); 175await context.Response.WriteAsync("Cross origin response"); 240await context.Response.WriteAsync("Cross origin response"); 309await context.Response.WriteAsync("Cross origin response"); 352await context.Response.WriteAsync("Cross origin response"); 448await context.Response.WriteAsync("Cross origin response"); 526await context.Response.WriteAsync("Cross origin response");
Microsoft.AspNetCore.Diagnostics (3)
DeveloperExceptionPage\DeveloperExceptionPageMiddlewareImpl.cs (1)
247await httpContext.Response.WriteAsync(sb.ToString());
StatusCodePage\StatusCodePagesExtensions.cs (1)
80return context.HttpContext.Response.WriteAsync(body);
StatusCodePage\StatusCodePagesOptions.cs (1)
35await context.HttpContext.Response.WriteAsync(body);
Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore (1)
MigrationsEndPointMiddleware.cs (1)
140await response.WriteAsync(error.PadRight(513));
Microsoft.AspNetCore.Diagnostics.HealthChecks (1)
HealthCheckResponseWriters.cs (1)
24_ => httpContext.Response.WriteAsync(result.Status.ToString())
Microsoft.AspNetCore.Diagnostics.HealthChecks.Tests (2)
HealthCheckEndpointRouteBuilderExtensionsTest.cs (1)
104await context.Response.WriteAsync("Custom!");
HealthCheckMiddlewareTests.cs (1)
309return c.Response.WriteAsync(json);
Microsoft.AspNetCore.Diagnostics.Middleware.Tests (6)
Latency\AcceptanceTests.cs (1)
72await context.Response.WriteAsync("Hello World!");
Latency\ChecpointAcceptanceTests.cs (2)
58app.UseEndpoints(endpoints => endpoints.MapGet("/", async context => await context.Response.WriteAsync("Hello World!"))); 99app.UseEndpoints(endpoints => endpoints.MapGet("/", async context => await context.Response.WriteAsync("Hello World!")));
Logging\AcceptanceTests.cs (3)
73await context.Response.WriteAsync("test body"); 91await context.Response.WriteAsync("Server: hello!").ConfigureAwait(false); 94await context.Response.WriteAsync("Server: world!").ConfigureAwait(false);
Microsoft.AspNetCore.Diagnostics.Tests (28)
DeveloperExceptionPageMiddlewareTest.cs (3)
653return context.HttpContext.Response.WriteAsync(context.Exception.Message); 661return context.HttpContext.Response.WriteAsync(context.Exception.ToString()); 669return context.HttpContext.Response.WriteAsync("An error occurred");
ExceptionHandlerTest.cs (22)
43await httpContext.Response.WriteAsync("Handled error in a custom way."); 51await context.Response.WriteAsync("An error occurred while adding a product"); 99await httpContext.Response.WriteAsync("Handled error in a custom way."); 105await httpContext.Response.WriteAsync("Hello"); 163await httpContext.Response.WriteAsync(expectedResponseBody); 170await context.Response.WriteAsync(new string('a', 100)); 222await httpContext.Response.WriteAsync(expectedResponseBody); 272await httpContext.Response.WriteAsync("Handled error in a custom way."); 283await httpContext.Response.WriteAsync(expectedResponseBody); 344await httpContext.Response.WriteAsync("Custom 404"); 412await httpContext.Response.WriteAsync("Handled error in a custom way."); 423await httpContext.Response.WriteAsync("Hello"); 474await httpContext.Response.WriteAsync("Handled error in a custom way."); 580await httpContext.Response.WriteAsync("Handled error in a custom way."); 750return c.Response.WriteAsync("separate pipeline"); 806return c.Response.WriteAsync("Handled"); 860return c.Response.WriteAsync("Handled"); 912return c.Response.WriteAsync("Handled"); 961return httpContext.Response.WriteAsync("Custom handler"); 970return c.Response.WriteAsync("Handled"); 1013return httpContext.Response.WriteAsync("Custom handler"); 1146return httpContext.Response.WriteAsync("Custom handler");
StatusCodeMiddlewareTest.cs (3)
44await httpContext.Response.WriteAsync(httpContext.Request.QueryString.Value); 107await httpContext.Response.WriteAsync( 169await httpContext.Response.WriteAsync(
Microsoft.AspNetCore.FunctionalTests (1)
WebHostFunctionalTests.cs (1)
122using (var webHost = WebHost.Start("http://127.0.0.1:0", context => context.Response.WriteAsync("Hello, World!")))
Microsoft.AspNetCore.Hosting.Tests (3)
WebHostBuilderTests.cs (3)
97return context.Response.WriteAsync("This wins"); 115app.Run(context => context.Response.WriteAsync("UseStartupFactoryWorks")); 851app.Run(context => context.Response.WriteAsync("Configure"));
Microsoft.AspNetCore.Hosting.TestSites (1)
StartupShutdown.cs (1)
35return context.Response.WriteAsync("Hello World");
Microsoft.AspNetCore.Http.Abstractions.Tests (6)
HttpResponseWritingExtensionsTests.cs (3)
14await context.Response.WriteAsync("Hello World"); 23await context.Response.WriteAsync("Hello World"); 24await context.Response.WriteAsync("Hello World");
UsePathBaseExtensionsTests.cs (3)
154endpoints.Map("/path", context => context.Response.WriteAsync("Response")); 177app.MapGet("/path", context => context.Response.WriteAsync("Response")); 197app.MapGet("/path", context => context.Response.WriteAsync("Response"));
Microsoft.AspNetCore.Http.Connections (8)
Internal\HttpConnectionDispatcher.cs (7)
464await context.Response.WriteAsync("POST requests are not allowed for WebSocket connections."); 557await context.Response.WriteAsync("Cannot terminate this connection using the DELETE endpoint."); 577await context.Response.WriteAsync($"{transportType} transport not supported by this end point type"); 598await context.Response.WriteAsync("Cannot change transports mid-connection"); 782await context.Response.WriteAsync("Connection ID required"); 792await context.Response.WriteAsync("No Connection with that ID"); 815await context.Response.WriteAsync("No Connection with that ID");
Internal\Transports\ServerSentEventsServerTransport.cs (1)
47await context.Response.WriteAsync(":\r\n", cancellationToken);
Microsoft.AspNetCore.Http.Connections.Tests (2)
HttpConnectionDispatcherTests.cs (2)
3237return context.Response.WriteAsync(GenerateToken(context)); 3399return context.Response.WriteAsync(GenerateToken(context));
Microsoft.AspNetCore.Http.Extensions (6)
RequestDelegateFactory.cs (5)
2465await httpContext.Response.WriteAsync(await task); 2470return httpContext.Response.WriteAsync(task.GetAwaiter().GetResult()!); 2479return httpContext.Response.WriteAsync(text); 2567await httpContext.Response.WriteAsync(await task); 2572return httpContext.Response.WriteAsync(task.GetAwaiter().GetResult()!);
src\Shared\RouteHandlers\ExecuteHandlerHelper.cs (1)
22return httpContext.Response.WriteAsync(stringValue);
Microsoft.AspNetCore.Http.Extensions.Tests (3)
RequestDelegateFactoryTests.cs (2)
3612return httpContext.Response.WriteAsync(_resultString); 3627return httpContext.Response.WriteAsync(_resultString);
RequestDelegateGenerator\SharedTypes.cs (1)
978httpContext.Response.WriteAsync("Already gone!");
Microsoft.AspNetCore.Http.Microbenchmarks (1)
src\Http\Http.Extensions\test\RequestDelegateGenerator\SharedTypes.cs (1)
978httpContext.Response.WriteAsync("Already gone!");
Microsoft.AspNetCore.HttpLogging.Tests (12)
HttpLoggingMiddlewareTests.cs (12)
822await c.Response.WriteAsync("test"); 845await c.Response.WriteAsync("test"); 869await c.Response.WriteAsync("test"); 915await c.Response.WriteAsync("test"); 941await c.Response.WriteAsync("test"); 965await c.Response.WriteAsync("test"); 1031return c.Response.WriteAsync(expected); 1072return c.Response.WriteAsync(input); 1099await c.Response.WriteAsync("test"); 1168return c.Response.WriteAsync(expected); 1515await c.Response.WriteAsync("test response"); 2002await context.Response.WriteAsync("Hello World");
Microsoft.AspNetCore.HttpsPolicy.Tests (18)
HstsMiddlewareTests.cs (8)
55return context.Response.WriteAsync("Hello world"); 102return context.Response.WriteAsync("Hello world"); 148return context.Response.WriteAsync("Hello world"); 193return context.Response.WriteAsync("Hello world"); 248return context.Response.WriteAsync("Hello world"); 303return context.Response.WriteAsync("Hello world"); 350return context.Response.WriteAsync("Hello world"); 397return context.Response.WriteAsync("Hello world");
HttpsPolicyTests.cs (1)
54return context.Response.WriteAsync("Hello world");
HttpsRedirectionMiddlewareTests.cs (9)
41return context.Response.WriteAsync("Hello world"); 96return context.Response.WriteAsync("Hello world"); 152return context.Response.WriteAsync("Hello world"); 206return context.Response.WriteAsync("Hello world"); 252return context.Response.WriteAsync("Hello world"); 295return context.Response.WriteAsync("Hello world"); 338return context.Response.WriteAsync("Hello world"); 391return context.Response.WriteAsync("Hello world"); 433return context.Response.WriteAsync("Hello world");
Microsoft.AspNetCore.Localization.Routing.Tests (3)
RouteDataRequestCultureProviderTest.cs (3)
67return context.Response.WriteAsync( 119return context.Response.WriteAsync( 189return context.Response.WriteAsync(
Microsoft.AspNetCore.Mvc.Core.Test (2)
Filters\MiddlewareFilterTest.cs (1)
500return context.HttpContext.Response.WriteAsync("Shortcircuited");
Infrastructure\ControllerActionInvokerTest.cs (1)
1728await c.HttpContext.Response.WriteAsync(c.Object.ToString());
Microsoft.AspNetCore.Mvc.ViewFeatures.Test (2)
Filters\SaveTempDataFilterTest.cs (2)
385return context.HttpContext.Response.WriteAsync($"Hello from {nameof(TestActionResult)}"); 393return context.HttpContext.Response.WriteAsync($"Hello from {nameof(TestKeepTempDataActionResult)}");
Microsoft.AspNetCore.OpenApi (1)
Extensions\OpenApiEndpointRouteBuilderExtensions.cs (1)
42await context.Response.WriteAsync($"No OpenAPI document with the name '{documentName}' was found.");
Microsoft.AspNetCore.OutputCaching.Tests (11)
OutputCacheMiddlewareTests.cs (9)
613await context.HttpContext.Response.WriteAsync(new string('0', 20)); 642await context.HttpContext.Response.WriteAsync(new string('0', 10)); 674await context.HttpContext.Response.WriteAsync(new string('0', 10)); 700await context.HttpContext.Response.WriteAsync(new string('0', 10)); 724await context.HttpContext.Response.WriteAsync(new string('0', 10)); 745await context.HttpContext.Response.WriteAsync(new string('0', 10)); 772await context.HttpContext.Response.WriteAsync(new string('0', 101)); 976await context.HttpContext.Response.WriteAsync("Hello"); 1025await c.Response.WriteAsync(Guid.NewGuid().ToString());
TestUtils.cs (2)
51await context.Response.WriteAsync(uniqueId); 62await context.Response.WriteAsync(uniqueId);
Microsoft.AspNetCore.ResponseCaching.Tests (2)
TestUtils.cs (2)
76await context.Response.WriteAsync(uniqueId); 87await context.Response.WriteAsync(uniqueId);
Microsoft.AspNetCore.ResponseCompression.Tests (14)
ResponseCompressionMiddlewareTest.cs (14)
167return context.Response.WriteAsync(new string('a', 100)); 462return context.Response.WriteAsync(new string('a', 100)); 525return context.Response.WriteAsync(new string('a', 100)); 588return context.Response.WriteAsync(new string('a', 100)); 642await context.Response.WriteAsync(new string('a', 100)); 688await context.Response.WriteAsync(new string('a', 100)); 790await context.Response.WriteAsync(new string('a', 10)); 793await context.Response.WriteAsync(new string('a', 90)); 924await context.Response.WriteAsync("a"); 988await context.Response.WriteAsync("a"); 1151await context.Response.WriteAsync(new string('a', 100)); 1199await context.Response.WriteAsync(new string('a', 10)); 1202await context.Response.WriteAsync(new string('a', 90)); 1268return context.Response.WriteAsync(new string('a', uncompressedBodyLength));
Microsoft.AspNetCore.Rewrite.Tests (49)
ApacheModRewrite\ModRewriteMiddlewareTest.cs (17)
27app.Run(context => context.Response.WriteAsync(context.Request.Path)); 53app.Run(context => context.Response.WriteAsync(context.Request.Path)); 79app.Run(context => context.Response.WriteAsync(context.Request.Path)); 104app.Run(context => context.Response.WriteAsync(context.Request.Path)); 129app.Run(context => context.Response.WriteAsync(context.Request.Path)); 154app.Run(context => context.Response.WriteAsync(context.Request.Path)); 179app.Run(context => context.Response.WriteAsync(context.Request.Path)); 206app.Run(context => context.Response.WriteAsync(context.Request.Path)); 237app.Run(context => context.Response.WriteAsync(context.Request.Path)); 263app.Run(context => context.Response.WriteAsync(context.Request.Path)); 289app.Run(context => context.Response.WriteAsync(context.Request.Scheme + "://" + context.Request.Host.Host + context.Request.Path + context.Request.QueryString)); 315app.Run(context => context.Response.WriteAsync(context.Request.Scheme + "://" + context.Request.Host.Host + context.Request.Path + context.Request.QueryString)); 342app.Run(context => context.Response.WriteAsync(context.Request.Scheme + "://" + context.Request.Host.Host + context.Request.Path + context.Request.QueryString)); 370app.Run(context => context.Response.WriteAsync(context.Request.Scheme + "://" + context.Request.Host.Host + context.Request.Path + context.Request.QueryString)); 398app.Run(context => context.Response.WriteAsync(context.Request.Path + context.Request.QueryString)); 422app.Run(context => context.Response.WriteAsync( 452app.Run(context => context.Response.WriteAsync(
IISUrlRewrite\MiddleWareTests.cs (12)
37app.Run(context => context.Response.WriteAsync(context.Response.Headers.Location)); 69app.Run(context => context.Response.WriteAsync(context.Request.Path + context.Request.QueryString)); 105app.Run(context => context.Response.WriteAsync(context.Request.Path + context.Request.QueryString)); 137app.Run(context => context.Response.WriteAsync(context.Response.Headers.Location)); 276app.Run(context => context.Response.WriteAsync( 313app.Run(context => context.Response.WriteAsync( 350app.Run(context => context.Response.WriteAsync( 387app.Run(context => context.Response.WriteAsync( 421app.Run(context => context.Response.WriteAsync( 608app.Run(context => context.Response.WriteAsync(context.Request.GetEncodedUrl())); 653app.Run(context => context.Response.WriteAsync(context.Request.GetEncodedUrl())); 740app.Run(context => context.Response.WriteAsync(context.Request.GetEncodedUrl()));
MiddlewareTests.cs (20)
28app.Run(context => context.Response.WriteAsync( 58app.Run(context => context.Response.WriteAsync( 90app.Run(context => context.Response.WriteAsync( 122app.Run(context => context.Response.WriteAsync( 659endpoints.MapGet("/foos", context => context.Response.WriteAsync("bad")); 660endpoints.MapGet("/foo", context => context.Response.WriteAsync($"{context.GetEndpoint()?.DisplayName} from {context.Request.Path}")); 686app.Run(context => context.Response.WriteAsync( 713app.Run(context => context.Response.WriteAsync( 857endpoints.MapGet("/foo", context => context.Response.WriteAsync( 860endpoints.MapGet("/g", context => context.Response.WriteAsync( 895endpoints.MapGet("/foo", context => context.Response.WriteAsync( 898endpoints.MapGet("/g", context => context.Response.WriteAsync( 931endpoints.MapGet("/foo", context => context.Response.WriteAsync( 934endpoints.MapGet("/g", context => context.Response.WriteAsync( 968endpoints.MapGet("/foo", context => context.Response.WriteAsync( 971endpoints.MapGet("/g/h", context => context.Response.WriteAsync( 1005endpoints.MapGet("/foo", context => context.Response.WriteAsync( 1008endpoints.MapGet("/g", context => context.Response.WriteAsync( 1038app.MapGet("/foo", context => context.Response.WriteAsync( 1041app.MapGet("/g", context => context.Response.WriteAsync(
Microsoft.AspNetCore.Routing (1)
src\Shared\RouteHandlers\ExecuteHandlerHelper.cs (1)
22return httpContext.Response.WriteAsync(stringValue);
Microsoft.AspNetCore.Routing.FunctionalTests (5)
WebHostBuilderExtensionsTest.cs (5)
24(rb) => rb.MapGet("greeting/{name}", (req, resp, routeData) => resp.WriteAsync($"Hello! {routeData.Values["name"]}")), 35await resp.WriteAsync($"{routeData.Values["name"]} {data}"); 47await resp.WriteAsync($"{routeData.Values["name"]} {data}"); 53(rb) => rb.MapDelete("greeting/{name}", (req, resp, routeData) => resp.WriteAsync($"Hello! {routeData.Values["name"]}")), 65await resp.WriteAsync($"{routeData.Values["name"]} {data}");
Microsoft.AspNetCore.Routing.Tests (1)
Builder\RequestDelegateEndpointRouteBuilderExtensionsTest.cs (1)
90await context.Response.WriteAsync("Response string text");
Microsoft.AspNetCore.Server.HttpSys.FunctionalTests (51)
DelegateTests.cs (7)
42await httpContext.Response.WriteAsync(_expectedResponseString); 85await httpContext.Response.WriteAsync(_expectedResponseString); 106await httpContext.Response.WriteAsync(_expectedResponseString); 120httpContext.Response.WriteAsync(_expectedResponseString); 191await httpContext.Response.WriteAsync(_expectedResponseString); 225await httpContext.Response.WriteAsync(_expectedResponseString); 252await httpContext.Response.WriteAsync(_expectedResponseString);
Http2Tests.cs (5)
289return httpContext.Response.WriteAsync("Hello World"); 619return httpContext.Response.WriteAsync("Hello World"); 641return httpContext.Response.WriteAsync("Hello World"); 753await httpContext.Response.WriteAsync("Hello World"); 803await httpContext.Response.WriteAsync("Hello World");
Http3Tests.cs (10)
31await httpContext.Response.WriteAsync(httpContext.Request.Protocol); 35await httpContext.Response.WriteAsync(ex.ToString()); 59await httpContext.Response.WriteAsync(httpContext.Request.Protocol); 63await httpContext.Response.WriteAsync(ex.ToString()); 99await httpContext.Response.WriteAsync(httpContext.Request.Protocol); 103await httpContext.Response.WriteAsync(ex.ToString()); 134await httpContext.Response.WriteAsync(httpContext.Request.Protocol); 139await httpContext.Response.WriteAsync(ex.ToString()); 167await httpContext.Response.WriteAsync(ex.ToString()); 197await httpContext.Response.WriteAsync(ex.ToString());
HttpsTests.cs (3)
141await httpContext.Response.WriteAsync(ex.ToString()); 225await httpContext.Response.WriteAsync(ex.ToString()); 255await httpContext.Response.WriteAsync(ex.ToString());
OpaqueUpgradeTests.cs (6)
34return httpContext.Response.WriteAsync(ex.ToString()); 62return httpContext.Response.WriteAsync(ex.ToString()); 83await httpContext.Response.WriteAsync("Hello World"); 232await httpContext.Response.WriteAsync(ex.ToString()); 268await httpContext.Response.WriteAsync(ex.ToString()); 291await httpContext.Response.WriteAsync(ex.ToString());
ResponseBodyTests.cs (1)
29await httpContext.Response.WriteAsync("Hello World");
ResponseTests.cs (1)
243await httpContext.Response.WriteAsync("Body");
ResponseTrailersTests.cs (7)
103await httpContext.Response.WriteAsync("Hello World"); 125await httpContext.Response.WriteAsync(body); 155await httpContext.Response.WriteAsync(body); 157await httpContext.Response.WriteAsync(body); 181await httpContext.Response.WriteAsync(body); 207await httpContext.Response.WriteAsync(body); 251await httpContext.Response.WriteAsync("Hello World");
ServerTests.cs (11)
120return httpContext.Response.WriteAsync("Hello World"); 136await httpContext.Response.WriteAsync("Hello World"); 153return httpContext.Response.WriteAsync("Hello World"); 175await httpContext.Response.WriteAsync("Hello World"); 196await httpContext.Response.WriteAsync("Hello World"); 425await httpContext.Response.WriteAsync("Hello World"); 459await httpContext.Response.WriteAsync("Hello World"); 496await httpContext.Response.WriteAsync("Hello World"); 533await httpContext.Response.WriteAsync("Hello World"); 572await httpContext.Response.WriteAsync("Hello World"); 626return httpContext.Response.WriteAsync("Hello World");
Microsoft.AspNetCore.Server.Kestrel.Microbenchmarks (2)
Http2\Http2ConnectionEmptyBenchmark.cs (1)
26return ResponseDataLength == 0 ? Task.CompletedTask : httpContext.Response.WriteAsync(_responseData);
Http3\Http3ConnectionEmptyBenchmark.cs (1)
26return ResponseDataLength == 0 ? Task.CompletedTask : httpContext.Response.WriteAsync(_responseData);
Microsoft.AspNetCore.Server.Kestrel.Transport.Quic.Tests (7)
WebHostTests.cs (7)
68await context.Response.WriteAsync("hello, world"); 124await context.Response.WriteAsync("hello, world"); 159await context.Response.WriteAsync("hello, world"); 196await context.Response.WriteAsync("hello, world"); 234await context.Response.WriteAsync("hello, world"); 305await context.Response.WriteAsync("hello, world"); 400await context.Response.WriteAsync("hello, world");
Microsoft.AspNetCore.Session.Tests (5)
SessionTests.cs (5)
183return context.Response.WriteAsync(value.Value.ToString(CultureInfo.InvariantCulture)); 242return context.Response.WriteAsync(value.Value.ToString(CultureInfo.InvariantCulture)); 301return context.Response.WriteAsync(value.Value.ToString(CultureInfo.InvariantCulture)); 404return context.Response.WriteAsync(value.Value.ToString(CultureInfo.InvariantCulture)); 473return context.Response.WriteAsync(responseData);
Microsoft.AspNetCore.SignalR.Client.FunctionalTests (2)
Startup.cs (2)
119return context.Response.WriteAsync(GenerateJwtToken(name ?? "testuser")); 124return context.Response.WriteAsync(JsonConvert.SerializeObject(new
Microsoft.AspNetCore.SignalR.Tests (1)
Startup.cs (1)
100return context.Response.WriteAsync(GenerateToken(context));
Microsoft.AspNetCore.StaticFiles.FunctionalTests (3)
FallbackStaticFileTest.cs (2)
43return context.Response.WriteAsync("Hello, world!"); 95return context.Response.WriteAsync("Hello, world!");
StaticFileMiddlewareTests.cs (1)
65return context.Response.WriteAsync("Hi from endpoint.");
Microsoft.AspNetCore.StaticFiles.Tests (7)
DefaultFilesMiddlewareTests.cs (5)
70app.Run(context => context.Response.WriteAsync(context.Request.Path.Value)); 95return context.Response.WriteAsync(context.Request.Path.Value); 112app.Run(context => context.Response.WriteAsync(context.Request.Path.Value)); 152app.Run(context => context.Response.WriteAsync(context.Request.Path.Value)); 218app.Run(context => context.Response.WriteAsync(context.Request.Path.Value));
DirectoryBrowserMiddlewareTests.cs (1)
113return c.Response.WriteAsync("Hi from endpoint.");
StaticFileMiddlewareTests.cs (1)
385await ctx.Response.WriteAsync(responseText);
Microsoft.AspNetCore.TestHost.Tests (50)
ClientHandlerTests.cs (9)
206await context.Response.WriteAsync("Hello World"); 212await context.Response.WriteAsync("Bye World"); 409await context.Response.WriteAsync("BodyStarted,"); 411await context.Response.WriteAsync("BodyFinished"); 430await context.Response.WriteAsync("BodyFinished"); 527await context.Response.WriteAsync("BodyStarted"); 549return context.Response.WriteAsync("Hello World"); 583await context.Response.WriteAsync("Hello World"); 589await context.Response.WriteAsync(ex.ToString());
HttpContextBuilderTests.cs (6)
153await c.Response.WriteAsync("BodyStarted" + Environment.NewLine); 155await c.Response.WriteAsync("BodyFinished"); 179await c.Response.WriteAsync("BodyFinished"); 201await c.Response.WriteAsync("BodyFinished"); 250await c.Response.WriteAsync("BodyFinished"); 289await c.Response.WriteAsync("BodyStarted");
RequestLifetimeTests.cs (1)
79await httpContext.Response.WriteAsync("Hello World");
ResponseResetTests.cs (1)
139await httpContext.Response.WriteAsync("Hello World");
TestClientTests.cs (14)
28ctx.Response.WriteAsync(expected); 49return ctx.Response.WriteAsync(expected); 71return ctx.Response.WriteAsync(expected); 91await ctx.Response.WriteAsync(content + " PUT Response"); 110await ctx.Response.WriteAsync(await new StreamReader(ctx.Request.Body).ReadToEndAsync() + " POST Response"); 181await ctx.Response.WriteAsync("STARTED"); 185await ctx.Response.WriteAsync(requestString + " POST Response"); 351await ctx.Response.WriteAsync("POST Response"); 899return context.Response.WriteAsync("Done"); 924return context.Response.WriteAsync("Done"); 947await ctx.Response.WriteAsync(expected); 973await ctx.Response.WriteAsync(expected); 1000await ctx.Response.WriteAsync(expected); 1037await c.Response.WriteAsync("test");
TestServerTests.cs (19)
146app.Run(ctx => ctx.Response.WriteAsync( 198return context.Response.WriteAsync("RequestServices:" + (context.RequestServices != null)); 216await context.Response.WriteAsync(await sr.ReadToEndAsync()); 244await context.Response.WriteAsync("ApplicationServicesEqual:" + (applicationServices == Services)); 431return context.Response.WriteAsync("Found:" + (service != null)); 457return context.Response.WriteAsync("Success"); 501return context.Response.WriteAsync("Success"); 542return context.Response.WriteAsync("Success"); 563return context.Response.WriteAsync("FoundLogger:" + (logger != null)); 580return context.Response.WriteAsync("HasContext:" + (accessor.HttpContext != null)); 611return context.Response.WriteAsync("HasContext:" + (accessor.Accessor.HttpContext != null)); 632return context.Response.WriteAsync("CreateInvokesApp"); 648await context.Response.WriteAsync("Response"); 666await context.Response.WriteAsync("Response"); 731return context.Response.WriteAsync("Hello World"); 784ctx.Response.WriteAsync(ctx.Request.Headers.Host); 877builder.Run(ctx => ctx.Response.WriteAsync("Startup")); 906return context.Response.WriteAsync("FoundService:" + (service != null)); 915return context.Response.WriteAsync("FoundFoo:" + (service != null));
Microsoft.AspNetCore.Tests (8)
WebApplicationTests.cs (8)
1695await c.Response.WriteAsync("Hello World"); 1731await c.Response.WriteAsync("Hello World"); 1929await c.Response.WriteAsync("Hello World"); 1962await c.Response.WriteAsync("Hello World"); 1976await c.Response.WriteAsync("Hello World"); 1981await c.Response.WriteAsync("Hi New"); 2404return context => context.Response.WriteAsync("Hello World"); 3169await c.Response.WriteAsync("Hello Filter");
Microsoft.AspNetCore.WebSockets.Tests (1)
KestrelWebSocketHelpers.cs (1)
43await ct.Response.WriteAsync(ex.ToString());
MiddlewareAnalysisSample (6)
Startup.cs (6)
38return context.Response.WriteAsync("Hello World"); 63await context.Response.WriteAsync("<html><body>Welcome to the sample<br><br>\r\n"); 64await context.Response.WriteAsync("Click here to take a side branch: <a href=\"/map/foo\">Map</a><br>\r\n"); 65await context.Response.WriteAsync("Click here to throw an exception: <a href=\"/throw\">Throw</a><br>\r\n"); 66await context.Response.WriteAsync("Click here to for a 404: <a href=\"/404\">404</a><br>\r\n"); 67await context.Response.WriteAsync("</body></html>\r\n");
Mvc.RoutingWebSite (6)
Startup.cs (1)
98return c.Response.WriteAsync("Hello from middleware after routing");
StartupForDynamic.cs (1)
42return c.Response.WriteAsync("Hello from middleware after routing");
StartupForDynamicOrder.cs (1)
76return c.Response.WriteAsync("Hello from middleware after routing");
StartupForFallback.cs (1)
39return c.Response.WriteAsync("Hello from middleware after routing");
StartupRoutingDifferentBranches.cs (1)
73return c.Response.WriteAsync("Hello from middleware after routing");
StartupWithoutEndpointRouting.cs (1)
60return c.Response.WriteAsync("Hello from middleware after routing");
NativeIISSample (44)
Startup.cs (44)
36await context.Response.WriteAsync("Hello World - " + DateTimeOffset.Now + Environment.NewLine); 37await context.Response.WriteAsync(Environment.NewLine); 39await context.Response.WriteAsync("Address:" + Environment.NewLine); 40await context.Response.WriteAsync("Scheme: " + context.Request.Scheme + Environment.NewLine); 41await context.Response.WriteAsync("Host: " + context.Request.Headers["Host"] + Environment.NewLine); 42await context.Response.WriteAsync("PathBase: " + context.Request.PathBase.Value + Environment.NewLine); 43await context.Response.WriteAsync("Path: " + context.Request.Path.Value + Environment.NewLine); 44await context.Response.WriteAsync("Query: " + context.Request.QueryString.Value + Environment.NewLine); 45await context.Response.WriteAsync(Environment.NewLine); 47await context.Response.WriteAsync("Connection:" + Environment.NewLine); 48await context.Response.WriteAsync("RemoteIp: " + context.Connection.RemoteIpAddress + Environment.NewLine); 49await context.Response.WriteAsync("RemotePort: " + context.Connection.RemotePort + Environment.NewLine); 50await context.Response.WriteAsync("LocalIp: " + context.Connection.LocalIpAddress + Environment.NewLine); 51await context.Response.WriteAsync("LocalPort: " + context.Connection.LocalPort + Environment.NewLine); 52await context.Response.WriteAsync("ClientCert: " + context.Connection.ClientCertificate + Environment.NewLine); 53await context.Response.WriteAsync(Environment.NewLine); 55await context.Response.WriteAsync("User: " + context.User.Identity.Name + Environment.NewLine); 59await context.Response.WriteAsync("DisplayName: " + scheme?.DisplayName + Environment.NewLine); 62await context.Response.WriteAsync(Environment.NewLine); 64await context.Response.WriteAsync("Headers:" + Environment.NewLine); 67await context.Response.WriteAsync(header.Key + ": " + header.Value + Environment.NewLine); 69await context.Response.WriteAsync(Environment.NewLine); 71await context.Response.WriteAsync("Environment Variables:" + Environment.NewLine); 76await context.Response.WriteAsync(key + ": " + value + Environment.NewLine); 78await context.Response.WriteAsync(Environment.NewLine); 81await context.Response.WriteAsync("Server Variables:" + Environment.NewLine); 85await context.Response.WriteAsync(varName + ": " + context.GetServerVariable(varName) + Environment.NewLine); 88await context.Response.WriteAsync(Environment.NewLine); 91await context.Response.WriteAsync("Websocket feature is enabled."); 95await context.Response.WriteAsync("Websocket feature is disabled."); 98await context.Response.WriteAsync(Environment.NewLine); 104await context.Response.WriteAsync(key + Environment.NewLine); 109await context.Response.WriteAsync(Environment.NewLine); 110await context.Response.WriteAsync("IIS Environment Information:" + Environment.NewLine); 111await context.Response.WriteAsync("IIS Version: " + envFeature.IISVersion + Environment.NewLine); 112await context.Response.WriteAsync("ApplicationId: " + envFeature.ApplicationId + Environment.NewLine); 113await context.Response.WriteAsync("Application Path: " + envFeature.ApplicationPhysicalPath + Environment.NewLine); 114await context.Response.WriteAsync("Application Virtual Path: " + envFeature.ApplicationVirtualPath + Environment.NewLine); 115await context.Response.WriteAsync("Application Config Path: " + envFeature.AppConfigPath + Environment.NewLine); 116await context.Response.WriteAsync("AppPool ID: " + envFeature.AppPoolId + Environment.NewLine); 117await context.Response.WriteAsync("AppPool Config File: " + envFeature.AppPoolConfigFile + Environment.NewLine); 118await context.Response.WriteAsync("Site ID: " + envFeature.SiteId + Environment.NewLine); 119await context.Response.WriteAsync("Site Name: " + envFeature.SiteName + Environment.NewLine); 123await context.Response.WriteAsync($"No {nameof(IIISEnvironmentFeature)} available." + Environment.NewLine);
NegotiateAuthSample (1)
Startup.cs (1)
58await context.Response.WriteAsync($"Authenticated? {user.IsAuthenticated}, Name: {user.Name}, Protocol: {context.Request.Protocol}");
OpenIdConnectSample (37)
Startup.cs (37)
133return c.Response.WriteAsync(c.Exception.ToString()); 135return c.Response.WriteAsync("An error occurred processing your authentication."); 155await res.WriteAsync($"<h1>You have been signed out.</h1>"); 156await res.WriteAsync("<a class=\"btn btn-default\" href=\"/\">Home</a>"); 166await res.WriteAsync($"<h1>Signed out {HtmlEncode(context.User.Identity.Name)}</h1>"); 167await res.WriteAsync("<a class=\"btn btn-default\" href=\"/\">Home</a>"); 187await res.WriteAsync($"<h1>Access Denied error received from the remote authorization server</h1>"); 188await res.WriteAsync("<a class=\"btn btn-default\" href=\"/\">Home</a>"); 198await res.WriteAsync($"<h1>Access Denied for user {HtmlEncode(context.User.Identity.Name)} to resource '{HtmlEncode(context.Request.Query["ReturnUrl"])}'</h1>"); 199await res.WriteAsync("<a class=\"btn btn-default\" href=\"/signout\">Sign Out</a>"); 200await res.WriteAsync("<a class=\"btn btn-default\" href=\"/\">Home</a>"); 243await res.WriteAsync($"No refresh_token is available.<br>"); 244await res.WriteAsync("<a class=\"btn btn-link\" href=\"/signout\">Sign Out</a>"); 278await res.WriteAsync($"<h1>Refreshed.</h1>"); 279await res.WriteAsync("<a class=\"btn btn-default\" href=\"/refresh\">Refresh tokens</a>"); 280await res.WriteAsync("<a class=\"btn btn-default\" href=\"/\">Home</a>"); 282await res.WriteAsync("<h2>Tokens:</h2>"); 285await res.WriteAsync("<h2>Payload:</h2>"); 286await res.WriteAsync(HtmlEncoder.Default.Encode(payload.RootElement.ToString()).Replace(",", ",<br>") + "<br>"); 311await res.WriteAsync($"<h1>Hello Authenticated User {HtmlEncode(user.Identity.Name)}</h1>"); 312await res.WriteAsync("<a class=\"btn btn-default\" href=\"/refresh\">Refresh tokens</a>"); 313await res.WriteAsync("<a class=\"btn btn-default\" href=\"/restricted\">Restricted</a>"); 314await res.WriteAsync("<a class=\"btn btn-default\" href=\"/login-challenge\">Login challenge</a>"); 315await res.WriteAsync("<a class=\"btn btn-default\" href=\"/signout\">Sign Out</a>"); 316await res.WriteAsync("<a class=\"btn btn-default\" href=\"/signout-remote\">Sign Out Remote</a>"); 318await res.WriteAsync("<h2>Claims:</h2>"); 321await res.WriteAsync("<h2>Tokens:</h2>"); 332await response.WriteAsync($"<html><head>{bootstrap}</head><body><div class=\"container\">"); 334await response.WriteAsync("</div></body></html>"); 339await response.WriteAsync("<table class=\"table table-condensed\">"); 340await response.WriteAsync("<tr>"); 343await response.WriteAsync($"<th>{HtmlEncode(column)}</th>"); 345await response.WriteAsync("</tr>"); 348await response.WriteAsync("<tr>"); 351await response.WriteAsync($"<td>{HtmlEncode(column)}</td>"); 353await response.WriteAsync("</tr>"); 355await response.WriteAsync("</table>");
OutputCachingSample (3)
Gravatar.cs (2)
14await context.Response.WriteAsync($"<img src=\"https://www.gravatar.com/avatar/{hash}?s={size}&d={type}\"/>"); 15await context.Response.WriteAsync($"<pre>Generated at {DateTime.Now:hh:mm:ss.ff}</pre>");
Startup.cs (1)
54await context.Response.WriteAsync($"<pre>{requests++}</pre>");
QueueSharing (1)
Program.cs (1)
67await context.Response.WriteAsync("Hello world from " + context.Request.Host + " at " + DateTime.Now);
RazorPagesWebSite (1)
CustomActionResult.cs (1)
13return context.HttpContext.Response.WriteAsync(nameof(CustomActionResult));
RequestDecompressionSample (1)
Startup.cs (1)
26await context.Response.WriteAsync(decompressedBody, context.RequestAborted);
ResponseCachingSample (1)
Startup.cs (1)
27await context.Response.WriteAsync("Hello World! " + DateTime.UtcNow);
ResponseCompressionSample (2)
Startup.cs (2)
52await context.Response.WriteAsync("a"); 62await context.Response.WriteAsync(LoremIpsum.Text);
RewriteSample (1)
Startup.cs (1)
36return context.Response.WriteAsync($"Rewritten Url: {context.Request.Path + context.Request.QueryString}");
RoutingSandbox (9)
UseEndpointRoutingStartup.cs (6)
51return response.WriteAsync(sb.ToString()); 87frameworkBuilder.AddHubMethod("TestHub", "TestMethod", context => context.Response.WriteAsync("TestMethod!")); 88frameworkBuilder.AddHubMethod("Login", "Authenticate", context => context.Response.WriteAsync("Authenticate!")); 89frameworkBuilder.AddHubMethod("Login", "Logout", context => context.Response.WriteAsync("Logout!")); 98return context.Response.WriteAsync("I have ann authorize attribute"); 104return context.Response.WriteAsync("I have a method metadata attribute");
UseRouterStartup.cs (3)
25return httpContext.Response.WriteAsync($"Verb = {request.Method.ToUpperInvariant()} - Path = {request.Path} - Route values - {string.Join(", ", httpContext.GetRouteData().Values)}"); 28routes.MapGet("api/get/{id}", (request, response, routeData) => response.WriteAsync($"API Get {routeData.Values["id"]}")) 29.MapMiddlewareRoute("api/middleware", (appBuilder) => appBuilder.Run(httpContext => httpContext.Response.WriteAsync("Middleware!")))
RoutingWebSite (14)
MapFallbackStartup.cs (2)
20return context.Response.WriteAsync("FallbackCustomPattern"); 25return context.Response.WriteAsync("FallbackDefaultPattern");
UseEndpointRoutingStartup.cs (8)
53return response.WriteAsync(sb.ToString()); 71return httpContext.Response.WriteAsync((endpoint.Metadata.GetMetadata<CustomMetadata>() != null) ? "Has metadata" : "No metadata"); 83return response.WriteAsync("WithConstraints"); 92return response.WriteAsync("withoptionalconstraints"); 103return response.WriteAsync( 115return response.WriteAsync( 144return response.WriteAsync(hostsDisplay); 161endpoints.MapGet("api/get/{id}", (context) => context.Response.WriteAsync($"{name} - API Get {context.Request.RouteValues["id"]}"));
UseRouterStartup.cs (4)
25return httpContext.Response.WriteAsync($"Verb = {request.Method.ToUpperInvariant()} - Path = {request.Path} - Route values - {string.Join(", ", httpContext.GetRouteData().Values)}"); 28routes.MapGet("api/get/{id}", (request, response, routeData) => response.WriteAsync($"API Get {routeData.Values["id"]}")) 29.MapMiddlewareRoute("api/middleware", (appBuilder) => appBuilder.Run(httpContext => httpContext.Response.WriteAsync("Middleware!"))) 45routes.MapGet("api/get/{id}", (request, response, routeData) => response.WriteAsync($"{name} - API Get {routeData.Values["id"]}"));
SampleStartups (6)
StartupBlockingOnStart.cs (1)
28await context.Response.WriteAsync("Hello World!");
StartupConfigureAddresses.cs (1)
21await context.Response.WriteAsync("Hello World!");
StartupExternallyControlled.cs (1)
23await context.Response.WriteAsync("Hello World!");
StartupHelloWorld.cs (1)
20await context.Response.WriteAsync("Hello World!");
StartupInjection.cs (2)
54await context.Response.WriteAsync("Hello World!"); 71await context.Response.WriteAsync("Hello World!");
SelfHostServer (1)
Startup.cs (1)
31await context.Response.WriteAsync("Hello world from " + context.Request.Host + " at " + DateTime.Now);
ServerComparison.TestSites (14)
Startup.cs (1)
25return ctx.Response.WriteAsync("Hello World " + RuntimeInformation.ProcessArchitecture);
StartupNtlmAuthentication.cs (4)
43await context.Response.WriteAsync(ex.ToString()); 52return context.Response.WriteAsync("Anonymous?" + !context.User.Identity.IsAuthenticated); 59return context.Response.WriteAsync("Authenticated"); 72return context.Response.WriteAsync("Hello World");
StartupResponseCompression.cs (3)
30return context.Response.WriteAsync(helloWorldBody); 41return context.Response.WriteAsync(helloWorldBody); 58return context.Response.WriteAsync(body);
StartupResponses.cs (6)
20return context.Response.WriteAsync("Content Length"); 29await context.Response.WriteAsync("Connnection Close"); 38await context.Response.WriteAsync("Chunked"); 48return context.Response.WriteAsync("10\r\nManually Chunked\r\n0\r\n\r\n"); 58return context.Response.WriteAsync("1A\r\nManually Chunked and Close\r\n0\r\n\r\n"); 64return context.Response.WriteAsync("Running");
SessionSample (7)
Startup.cs (7)
53await context.Response.WriteAsync("Counting: You have visited our page this many times: " + visits); 61await context.Response.WriteAsync("<html><body>"); 64await context.Response.WriteAsync("Your session has not been established.<br>"); 65await context.Response.WriteAsync(DateTime.Now + "<br>"); 66await context.Response.WriteAsync("<a href=\"/session\">Establish session</a>.<br>"); 71await context.Response.WriteAsync("Your session was located, you've visited the site this many times: " + visits); 73await context.Response.WriteAsync("</body></html>");
SignalR.Client.FunctionalTestApp (3)
Startup.cs (3)
171return context.Response.WriteAsync($"{{ \"url\": \"{newUrl}\" }}"); 208return context.Response.WriteAsync("Some response from server"); 243return context.Response.WriteAsync(GenerateJwtToken());
SocialSample (48)
Startup.cs (48)
218await context.Response.WriteAsync("<html><body>"); 219await context.Response.WriteAsync("A remote failure has occurred: <br>" + 224await context.Response.WriteAsync("Properties:<br>"); 227await context.Response.WriteAsync($"-{ HtmlEncoder.Default.Encode(pair.Key)}={ HtmlEncoder.Default.Encode(pair.Value)}<br>"); 231await context.Response.WriteAsync("<a href=\"/\">Home</a>"); 232await context.Response.WriteAsync("</body></html>"); 261await response.WriteAsync("<html><body>"); 262await response.WriteAsync("Choose an authentication scheme: <br>"); 266await response.WriteAsync("<a href=\"?authscheme=" + provider.Name + "\">" + (provider.DisplayName ?? "(suppressed)") + "</a><br>"); 268await response.WriteAsync("</body></html>"); 313await response.WriteAsync("<html><body>"); 314await response.WriteAsync("No refresh_token is available.<br>"); 315await response.WriteAsync("<a href=\"/\">Home</a>"); 316await response.WriteAsync("</body></html>"); 386await response.WriteAsync("<html><body>"); 387await response.WriteAsync("Refresh has not been implemented for this provider.<br>"); 388await response.WriteAsync("<a href=\"/\">Home</a>"); 389await response.WriteAsync("</body></html>"); 401await response.WriteAsync("<html><body>"); 402await response.WriteAsync("You have been logged out. Goodbye " + context.User.Identity.Name + "<br>"); 403await response.WriteAsync("<a href=\"/\">Home</a>"); 404await response.WriteAsync("</body></html>"); 415await response.WriteAsync("<html><body>"); 416await response.WriteAsync("An remote failure has occurred: " + context.Request.Query["FailureMessage"] + "<br>"); 417await response.WriteAsync("<a href=\"/\">Home</a>"); 418await response.WriteAsync("</body></html>"); 449await response.WriteAsync("<html><body>"); 450await response.WriteAsync("Hello " + (context.User.Identity.Name ?? "anonymous") + "<br>"); 453await response.WriteAsync(claim.Type + ": " + claim.Value + "<br>"); 456await response.WriteAsync("Tokens:<br>"); 458await response.WriteAsync("Access Token: " + await context.GetTokenAsync("access_token") + "<br>"); 459await response.WriteAsync("Refresh Token: " + await context.GetTokenAsync("refresh_token") + "<br>"); 460await response.WriteAsync("Token Type: " + await context.GetTokenAsync("token_type") + "<br>"); 461await response.WriteAsync("expires_at: " + await context.GetTokenAsync("expires_at") + "<br>"); 462await response.WriteAsync("<a href=\"/logout\">Logout</a><br>"); 463await response.WriteAsync("<a href=\"/refresh_token\">Refresh Token</a><br>"); 464await response.WriteAsync("</body></html>"); 493await response.WriteAsync("<html><body>"); 494await response.WriteAsync("Refreshed.<br>"); 495await response.WriteAsync(HtmlEncoder.Default.Encode(payload.RootElement.ToString()).Replace(",", ",<br>") + "<br>"); 497await response.WriteAsync("<br>Tokens:<br>"); 499await response.WriteAsync("Access Token: " + authProperties.GetTokenValue("access_token") + "<br>"); 500await response.WriteAsync("Refresh Token: " + authProperties.GetTokenValue("refresh_token") + "<br>"); 501await response.WriteAsync("Token Type: " + authProperties.GetTokenValue("token_type") + "<br>"); 502await response.WriteAsync("expires_at: " + authProperties.GetTokenValue("expires_at") + "<br>"); 504await response.WriteAsync("<a href=\"/\">Home</a><br>"); 505await response.WriteAsync("<a href=\"/refresh_token\">Refresh Token</a><br>"); 506await response.WriteAsync("</body></html>");
Sockets.BindTests (3)
SocketTransportOptionsTests.cs (1)
120app => app.Run(ctx => ctx.Response.WriteAsync("Hello World"))
src\Servers\Kestrel\test\BindTests\AddressRegistrationTests.cs (2)
251return context.Response.WriteAsync(serverAddresses.Addresses.First()); 1189return context.Response.WriteAsync(context.Request.GetDisplayUrl());
Sockets.FunctionalTests (15)
src\Servers\Kestrel\test\FunctionalTests\Http2\HandshakeTests.cs (2)
76return context.Response.WriteAsync("hello world " + context.Request.Protocol); 104return context.Response.WriteAsync("hello world " + context.Request.Protocol);
src\Servers\Kestrel\test\FunctionalTests\Http2\ShutdownTests.cs (3)
73return context.Response.WriteAsync("hello world " + context.Request.Protocol); 130await context.Response.WriteAsync("hello world " + context.Request.Protocol); 181await context.Response.WriteAsync("hello world " + context.Request.Protocol);
src\Servers\Kestrel\test\FunctionalTests\MaxRequestBufferSizeTests.cs (2)
361await context.Response.WriteAsync("Client sent more bytes than expectedBody.Length"); 365await context.Response.WriteAsync($"bytesRead: {bytesRead}");
src\Servers\Kestrel\test\FunctionalTests\RequestTests.cs (4)
106await context.Response.WriteAsync($"bytesRead: {total}"); 173await context.Response.WriteAsync("hello, world"); 869await response.WriteAsync("World"); 1106await context.Response.WriteAsync(JsonConvert.SerializeObject(new
src\Servers\Kestrel\test\FunctionalTests\ResponseTests.cs (3)
115await context.Response.WriteAsync(""); 161await httpContext.Response.WriteAsync("hello, world"); 221await response.WriteAsync(largeString, cancellationToken: lifetime.RequestAborted);
src\Servers\Kestrel\test\FunctionalTests\UnixDomainSocketsTests.cs (1)
153await context.Response.WriteAsync("Hello World");
StartRequestDelegateUrlApp (1)
Program.cs (1)
24await context.Response.WriteAsync(env.ApplicationName);
StartRouteBuilderUrlApp (1)
Program.cs (1)
25await res.WriteAsync(env.ApplicationName);
StartWithIApplicationBuilderUrlApp (1)
Program.cs (1)
27await context.Response.WriteAsync(env.ApplicationName);
StatusCodePagesSample (2)
Startup.cs (2)
75await context.Response.WriteAsync(builder.ToString()); 103await context.Response.WriteAsync(builder.ToString());
SystemdTestApp (1)
Startup.cs (1)
35await context.Response.WriteAsync(response);
Wasm.Performance.Driver (1)
BenchmarkResultsStartup.cs (1)
26await context.Response.WriteAsync("OK");
WebTransportInteractiveSampleApp (1)
Program.cs (1)
50await context.Response.WriteAsync($"var CERTIFICATE = '{certStr}';");
WsFedSample (21)
Startup.cs (21)
50await res.WriteAsync($"<h1>You have been signed out.</h1>"); 51await res.WriteAsync("<a class=\"btn btn-link\" href=\"/\">Sign In</a>"); 61await context.Response.WriteAsync($"<h1>Signed out {HtmlEncode(context.User.Identity.Name)}</h1>"); 62await context.Response.WriteAsync("<a class=\"btn btn-link\" href=\"/\">Sign In</a>"); 82await context.Response.WriteAsync($"<h1>Access Denied for user {HtmlEncode(context.User.Identity.Name)} to resource '{HtmlEncode(context.Request.Query["ReturnUrl"])}'</h1>"); 83await context.Response.WriteAsync("<a class=\"btn btn-link\" href=\"/signout\">Sign Out</a>"); 118await response.WriteAsync($"<h1>Hello Authenticated User {HtmlEncode(user.Identity.Name)}</h1>"); 119await response.WriteAsync("<a class=\"btn btn-default\" href=\"/restricted\">Restricted</a>"); 120await response.WriteAsync("<a class=\"btn btn-default\" href=\"/signout\">Sign Out</a>"); 121await response.WriteAsync("<a class=\"btn btn-default\" href=\"/signout-remote\">Sign Out Remote</a>"); 123await response.WriteAsync("<h2>Claims:</h2>"); 134await response.WriteAsync($"<html><head>{bootstrap}</head><body><div class=\"container\">"); 136await response.WriteAsync("</div></body></html>"); 141await response.WriteAsync("<table class=\"table table-condensed\">"); 142await response.WriteAsync("<tr>"); 145await response.WriteAsync($"<th>{HtmlEncode(column)}</th>"); 147await response.WriteAsync("</tr>"); 150await response.WriteAsync("<tr>"); 153await response.WriteAsync($"<td>{HtmlEncode(column)}</td>"); 155await response.WriteAsync("</tr>"); 157await response.WriteAsync("</table>");