« Previous Next »

Thread: unable to read a POSTed message from STDIN

Last post 07-13-2009 5:07 PM by davcox. 1 replies.

Average Rating Rate It (5)

RSS

Page 1 of 1 (2 items)

Sort Posts:

  • 04-16-2009, 6:20 AM

    • Karim1967
    • Not Ranked
    • Joined on 04-16-2009, 10:08 AM
    • Posts 1

    unable to read a POSTed message from STDIN

    Hi all,

    This is my first post ever on this forum so sorry in advance if Im not in the right place.

    I am using a very simple cgi perl script to read incoming data sent via the POST method.

    Normally, the message body should be in the server's STDIN(standard input). When working locally (across our local network), everything is fine. Whenever I get a POST request from our trading Partners in the US, STDIN seems to be somehow closed!!

    the perl code is:

         if ($ENV{'REQUEST_METHOD'} eq "POST")
        {
     binmode STDIN;
     read(STDIN, $buf, $ENV{CONTENT_LENGTH});
        }else {
     $buf = $ENV{QUERY_STRING};
        }

    The  $buf is always empty and the call does not succeed!!!

    Any help would be more than appreciated!!!

    Many thanks to all

    Karim

     

  • 07-13-2009, 5:07 PM In reply to

    • davcox
    • Top 50 Contributor
    • Joined on 07-21-2006, 2:28 PM
    • Redmond
    • Posts 213

    Re: unable to read a POSTed message from STDIN

    This is going to be specific to Perl's implementation of how it is handling POST data ... (IIS is not doing anything different, but simply giving the CGI POST data on it's standard in stream) are you sure there's no other difference between the "local" network and the "remote" one?  Are they using the same browser?  I was guessing their might be some chunking going on, or perhaps authentication? 

    Dave

Page 1 of 1 (2 items)
Microsoft Communities