Created
September 1, 2023 10:27
-
-
Save bjoerntx/effb99548b2175979943334d9fcc0dd8 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