Skip to content

Commit

Permalink
Improvements in Ticketer example (#1315)
Browse files Browse the repository at this point in the history
  • Loading branch information
kiapanahi authored Jun 3, 2021
1 parent 31009f6 commit 5bb5f48
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions examples/Ticketer/Client/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -74,14 +74,14 @@ static async Task Main(string[] args)
private static async Task<string> Authenticate()
{
Console.WriteLine($"Authenticating as {Environment.UserName}...");
var httpClient = new HttpClient();
var request = new HttpRequestMessage
using var httpClient = new HttpClient();
using var request = new HttpRequestMessage
{
RequestUri = new Uri($"{Address}/generateJwtToken?name={HttpUtility.UrlEncode(Environment.UserName)}"),
Method = HttpMethod.Get,
Version = new Version(2, 0)
};
var tokenResponse = await httpClient.SendAsync(request);
using var tokenResponse = await httpClient.SendAsync(request);
tokenResponse.EnsureSuccessStatusCode();

var token = await tokenResponse.Content.ReadAsStringAsync();
Expand Down

0 comments on commit 5bb5f48

Please sign in to comment.