aaronk Well-Known Member Licensed User Longtime User Jan 31, 2021 #1 Hi, I am using a server in my B4J (as an non-UI app) and I have used the PayPal Webhooks to trigger my B4J app. In the server logs I can see the incoming HTTP request. It logs what URL was requested, and the type is POST. As it's triggering my B4J when a payment is made, it is only logging the URL, and I believe there will be more information in the body of the request being made to my B4J app. Anyone know how to read the incoming POST part of the request, which I guess is the part I need rather than just a URL coming to my B4J app ?
Hi, I am using a server in my B4J (as an non-UI app) and I have used the PayPal Webhooks to trigger my B4J app. In the server logs I can see the incoming HTTP request. It logs what URL was requested, and the type is POST. As it's triggering my B4J when a payment is made, it is only logging the URL, and I believe there will be more information in the body of the request being made to my B4J app. Anyone know how to read the incoming POST part of the request, which I guess is the part I need rather than just a URL coming to my B4J app ?
alwaysbusy Expert Licensed User Longtime User Jan 31, 2021 #2 You can read the body part. Suppose it is json, you could do something like this: Code: Copy Dim bodyCode As String Dim body As TextReader body.Initialize(req.InputStream) bodyCode = body.ReadAll Dim jsonP As JSONParser jsonP.Initialize(bodyCode) Dim m As Map = jsonP.NextObject ... Upvote 0
You can read the body part. Suppose it is json, you could do something like this: Code: Copy Dim bodyCode As String Dim body As TextReader body.Initialize(req.InputStream) bodyCode = body.ReadAll Dim jsonP As JSONParser jsonP.Initialize(bodyCode) Dim m As Map = jsonP.NextObject ...