Last active
August 22, 2022 16:10
-
-
Save bjoerntx/10b6ab93fc013b557cb99bfd3e7d23d9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[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