Avatar of arthurh88
arthurh88
 asked on

Can we include POST data in IIS Logging?  How do we log GET and POST in IIS?

Currently, we have an IPN listener and paypal is sending us instant payment notifications to our server.  Our web application shows these coming in as HTTP GET from paypal, which is odd (they should be HTTP POST).  But in our IIS logs, it looks like they might be POST....as if our logging isn't really distinguishing between them.  Plus our IIS logs are not showing the whole URL being sent.


How can i configure IIS to log all the data sent in an HTTP Post? ...also is there a way to configure IIS logging to save whether a URL is accessed as a POST or a GET?    

Microsoft IIS Web Server

Avatar of undefined
Last Comment
arthurh88

8/22/2022 - Mon
Scott Fell

Are you 100% sure the API that is calling your server is a POST and not a GET?

Which endpoint is calling your server?
ste5an

Just run Wireshark in your development environment to see what they send you.

Also check the call, maybe it is an HATEOAS discovery to get the correct POST URL.
Kimputer

You don't handle POST by looking at your IIS logs. IIS logs are not meant for that. It never was.
You handle POSTs probably by logging it yourself. Since you wrote the code to listen, you can code it to log the POST data as well.
And if your IIS log shows POSTs, I believe that more than your web application saying it's GET. Your web application is programmed by you, IIS has been proven to work properly with GET and POSTs and logging it properly.
Wireshark as suggested above is obviously an option, but you'll have to fiddle around with your SSL certificate before you can read the data. And since you probably want the data logged anyway, why not just modify your current code with one or two lines of extra logging code?
All of life is about relationships, and EE has made a viirtual community a real community. It lifts everyone's boat
William Peck
ASKER CERTIFIED SOLUTION
Scott Fell

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
arthurh88

ASKER
this was very helpful.  i used notepad++ to remove all extra lines and focused only on our listener page and i saw exactly what you said and realized what the issue was, which ended up being that our server was configured to redirect all capital letters inside URL's to their lowercase equivalents and because paypal had a capitalized version of our URL, when paypal sent a POST to us, we were doing a 301 back to paypal, and then paypal resent to the correct URL as a GET and we ended up getting no data due to the GET.   So I reconfigured the IPN URL on paypal to be all lowercase and presto, it's all solved. .  thanks so much for your bit of insight, it led me on the right path to solving this.