I have a project in .NET that uses HTTP Listener to get all the POST body sent to my IP.
public void StartListener()
{
using (var httpListener = new HttpListener())
{
httpListener.Prefixes.Add(@“http://192.168.1.8:6345/”);try { httpListener.Start(); } catch { } while (httpListener.IsListening) { var context = httpListener.GetContext(); ProcessRequest(context); } } } private void ProcessRequest(HttpListenerContext context) { // Get the data from the HTTP stream var body = new StreamReader(context.Request.InputStream, context.Request.ContentEncoding).ReadToEnd(); Console.WriteLine(body); byte[] b = Encoding.UTF8.GetBytes("ACK"); context.Response.StatusCode = 200; context.Response.KeepAlive = false; context.Response.ContentLength64 = b.Length; var output = context.Response.OutputStream; output.Write(b, 0, b.Length); context.Response.Close(); }
All my friends confirmed that they can send me a request with anything on the body and I will, in fact, see it on my console. However I tried subscribing to a Webhook using someone’s popular stream that I know would get a lot of follows (Shroud, for example).
For testing purposes I tried using other websites like requestb.in to see if they get the requests, and they do. However, I do not get any post messages back to my listener when subscribing to that webhook. So far it’s the only thing I can’t receive, if I do a simple request with anything on the body to “http://MYIP:6345”, I will receive it and see it in the console.
I am using Postman to make the requests. Any ideas what could be wrong?