Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public async static Task<string> PostRequestSendReadyDocument()
- {
- using (var httpClient = new HttpClient())
- {
- using (var request = new HttpRequestMessage(new HttpMethod("POST"), "https://api.getaccept.com/v1/documents/595d2hrwg4j/send"))
- {
- var key = PostRequestAuthKey().Result;
- request.Headers.TryAddWithoutValidation("Authorization", "Bearer "+ key);
- request.Content = new StringContent("\t\n{\n\t \"sender_id\": \"5qr8darqd3r\"\n\t}\n");
- request.Content.Headers.ContentType = MediaTypeHeaderValue.Parse("application/json");
- var response = await httpClient.SendAsync(request);
- string responseBody = await response.Content.ReadAsStringAsync();
- string prettyJson = JToken.Parse(responseBody).ToString();
- Console.WriteLine(prettyJson);
- return prettyJson;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement