Remove 'Sse' from AspNetCoreSseServer sample name (#665)
This commit is contained in:
parent
da86d52241
commit
5e5b1af29b
1 changed files with 22 additions and 23 deletions
13
samples/ProtectedMcpServer/Tools/HttpClientExt.cs
Normal file
13
samples/ProtectedMcpServer/Tools/HttpClientExt.cs
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
using System.Text.Json;
|
||||
|
||||
namespace ModelContextProtocol;
|
||||
|
||||
internal static class HttpClientExt
|
||||
{
|
||||
public static async Task<JsonDocument> ReadJsonDocumentAsync(this HttpClient client, string requestUri)
|
||||
{
|
||||
using var response = await client.GetAsync(requestUri);
|
||||
response.EnsureSuccessStatusCode();
|
||||
return await JsonDocument.ParseAsync(await response.Content.ReadAsStreamAsync());
|
||||
}
|
||||
}
|
||||
Loading…
Reference in a new issue