reading http post to an page

Posted on 2012-08-22
Last Modified: 2012-08-23
so my company is a user of infusionsoft.

in the crm you are able to after an action occurs send an http post to another site.  i'm trying to do this to create a script that will log an action to my local sql db.  however, they dont tell you what variables they are sending over in the post.  so what i did was set up a simple page with a page_load event that will read the request.rawurl and print it to a text file.  however, nothing seems to be happening.  when i visit the site in my browser, it logs it okay.  

am i wrong that an http post would just be posting to a web page with query parameters as in: ?

or is a post different and can not be read in this manner because the page load is never executing?  I've read a couple things about this and but i'll i've found was how to do construct a get within my .net application and then read the post from that get w/ a defined uri that i set up.  any help would be appreciated experts!!  any tips on a way or a better idea how to do this would be fantastic!
Question by:rpzach
    LVL 35

    Expert Comment

    by:Robert Schutt
    The fields will only be sent in the querystring (behind the question mark) if the form's method is "GET". With a "POST" type form, which is more common for some actions, you will have to read Request.Form for example to get to the fields that were sent.

    However, if you are not getting anything from the Page_Load then there may be another problem altogether. How are you debugging this?
    LVL 1

    Author Comment

    I'm trying to loop through AllKeys and then i'm just printing it to a text file.  The WriteToLog function works well, it works if i manually go to the site i get a log entry...

    Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
            Dim logStr$
            For Each MyKey In Request.Form.AllKeys
                logStr = logStr & vbCrLf & MyKey

            Funcs.WriteToLog(logStr, True)
        End Sub
    LVL 35

    Accepted Solution

    Ok, that doesn't seem too complicated and you say it works 'manually' so I think we need to start checking another way.

    Can you please make sure that IIS logging is enabled (and preferably with all log fields) for the website/application/virtual directory that is being called. Then repeat your 2 tests (manually  and from the crm app) and look in the logs what is being called exactly. It should be possible for starters to check if it's Form or QueryString that is being used.
    LVL 1

    Author Comment


    That was a great tip.  The page was throwing an error I wasn't seeing I guess (I was debugging from the server so my writelogfunc worked great, but not so much publicly :P).

    Thanks man!


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    IT, Stop Being Called Into Every Meeting

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    Suggested Solutions

    Title # Comments Views Activity
    IIS7 IP Restriction via Load Balancer 23 47
    Query datatable in LINQ 6 24
    C# Winform panel within a panel 4 29
    Internet bottleneck? 11 48
    A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
    If you don't have the right permissions set for your WordPress location in IIS, you won't be able to perform automatic updates. Here's how to fix the problem.
    Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
    Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

    794 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    15 Experts available now in Live!

    Get 1:1 Help Now