in reply to CGI and web services

CGI will allow you to access the HTTP headers, and read input values from a http request. I would say it should be able to do everything that you need it to do.

Replies are listed 'Best First'.
Re^2: CGI and web services
by dshahin (Pilgrim) on Jan 30, 2007 at 03:59 UTC
    How do I access the Raw Post data? It won't be separated into name / value pairs so I'm not sure to access it from a CGI script.

    dan shahin

      Google checkout is going to send you a POST to your CGI script. It has to be a name/value pair. One of those name value pairs is going to contain your XML document.

      This should dump any data that you receive from a POST request. Use this as your script that Google Checkout will call; it will tell you what name/values you are receiving from them.

      #!/usr/bin/perl use CGI; my $q = new CGI; my @names = $q->param(); for my $name (@names) { warn "$name => " . $q->param($name) . "\n"; }

      Note:This data will be sent to the Apache error_log file.

        Your technique worked great! I guess there's a param called POSTDATA that contains what I need. I've written a client and a server that seem to be talking to each other.

        Now I need to perform basic HTTP authentication. Any pointers there?

        dan shahin

        from the Google documentation:

        Google sends you the new-order-notification to inform you that it has started processing an order. The new-order-notification includes the order's shopping cart, shipping method, tax, shipping address, and various other information. Google sends this and all other notifications as raw POST data, not as name/value pairs. You need to reply to the notification with a notification-acknowledgment message via HTTP response. See New Order Notifications for a complete description.

        That's what's confusing me. How can I access the raw Post data?