Skip to content

Commit

Permalink
Create request-status.cs
Browse files Browse the repository at this point in the history
Add request-status C# example for .NET
  • Loading branch information
datalogics-erics authored Apr 25, 2024
1 parent de81467 commit f7c142e
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions DotNET/Endpoint Examples/Multipart Payload/request-status.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
using System.Text;

using (var httpClient = new HttpClient { BaseAddress = new Uri("https://api.pdfrest.com") })
{
string requestId = "xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"; // requestId to poll
using (var request = new HttpRequestMessage(HttpMethod.Get, "request-status" + requestId))
{
request.Headers.TryAddWithoutValidation("Api-Key", "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx");

var response = await httpClient.SendAsync(request);

var apiResult = await response.Content.ReadAsStringAsync();

Console.WriteLine("API response received.");
Console.WriteLine(apiResult);
}
}

0 comments on commit f7c142e

Please sign in to comment.