Log Webhook requests

Boruch Tkatch 141 Reputation points
2020-12-09T20:22:24.45+00:00

Remote server periodically sends webhook notifications to us. I want to record the request and send back a 200. The request is a POST to /, so only the headers and payload matter, the headers for authentication, and the payload for the data. The data would be written to a file or database after which some other program would process it.

We have an SSL certificate and i setup my local IIS to host the website. I verified the payload is received via Failed Request Tracing.

I have been trying to write ASP.NET projects but cannot seem to figure out how to get the request into the program itself. There are a lot of examples of webhooks out there, but that seems like overkill for a project that uses no path and only receives a small payload. I am trying to figure out what is the simplest way to do this. Use IIS? ASP? It makes not difference whether the program is .net core or standard, or the language.

What is the simplest way to record an https post request with the payload and send back a 200?

ASP.NET Core
ASP.NET Core
A set of technologies in the .NET Framework for building web applications and XML web services.
4,684 questions
{count} votes

Accepted answer
  1. Boruch Tkatch 141 Reputation points
    2020-12-10T15:04:02.103+00:00

    The answer in my case is to use HttpListener. Add a prefix for https://server:port/, verify the source, and read HttpListenerContext.Request.InputStream.

    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.