Skip to content

Instantly share code, notes, and snippets.

@bjoerntx
Last active August 22, 2022 16:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bjoerntx/10b6ab93fc013b557cb99bfd3e7d23d9 to your computer and use it in GitHub Desktop.
Save bjoerntx/10b6ab93fc013b557cb99bfd3e7d23d9 to your computer and use it in GitHub Desktop.
[HttpPost]
public bool WebHook([FromBody] object request) {
dynamic ProcessingRequest = JObject.Parse(request.ToString());
HttpClient client = new HttpClient();
HttpResponseMessage responseMessage =
client.GetAsync(ProcessingRequest.RetrieveDocumentUrl.Value).Result;
if (responseMessage.IsSuccessStatusCode) {
string data = responseMessage.Content.ReadAsStringAsync().Result;
System.IO.File.WriteAllBytes(
"App_Data/" + ProcessingRequest.Id.Value + ".pdf", Convert.FromBase64String(data));
return true;
}
else
return true;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment