I'm using the Live HTTP Headers extension on Firefox to figure out what is being sent in a javascript page. I have narrowed the headers down, and am now using the Live HTTP Replay part of the Headers extension. Here's what's in Replay:

POST: http://scores.covers.com/ajax/SportsDirect.Controls.LiveScoresCo +ntrols.Scoreboard,SportsDirect.Controls.LiveScoresControls.ashx?_meth +od=UpdateScoreboard&_session=no Host: scores.covers.com User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2) +Gecko/20100115 Firefox/3.6 Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0. +8 Accept-Language: en-us,en;q=0.5 Accept-Encoding: gzip,deflate Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7 Keep-Alive: 115 Connection: keep-alive Referer: http://scores.covers.com/basketball-scores-matchups.aspx?t=0 Content-Length: 167 Content-Type: text/plain; charset=UTF-8 Cookie: WT_FPC=id=2a36d4f9a39ac80f0481267122335646:lv=1268419213631:ss +=1268419204254; __utma=75780999.682598437.1267111536.1268372315.12684 +08405.31; __utmz=75780999.1268372315.30.7.utmcsr=contests.covers.com| +utmccn=(referral)|utmcmd=referral|utmcct=/handicapping/experts/NBA-te +ams.aspx; CoversSignupReferrer=http://www.covers.com/index.aspx?t=0; +__utmc=75780999; ASP.NET_SessionId=5crxiiz4qrrvd445mkxtxxum; __utmb=7 +5780999.4.10.1268408405; LastDayViewed_9=2009-2010.2010.3.2; RefreshS +cores=12-2-2010-1268408433293 Pragma: no-cache Cache-Control: no-cache

And here's the POST content:

LeagueID=9\r\n GameDate=3-2-2010\r\n Season=2009-2010\r\n Refresh=true\r\n LastUpdateTime=01-01-1900\r\n type=Matchups\r\n RefreshStartTime=12-2-2010-1268408433293\r\n Week=\r\n conferenceID=

If I click the replay button, it brings up the data I need perfectly. So I've tried to copy this into a perl script, but I can't get it to work. Here is what I have:
#!/usr/bin/perl use strict; use HTTP::Request::Common; use LWP::UserAgent; my %fields = ( "LeagueID" => "9\r\n", "GameDate" => "3-2-2010\r\n", "Season" => "2009-2010\r\n", "Refresh" => "false\r\n", "LastUpdateTime" => "01-01-1900\r\n", "type" => "Matchups\r\n", "RefreshStartTime" => "11-2-2010-1268372427240\r\n", "Week" => "\r\n", "conferenceID" => "", ); my $robot = LWP::UserAgent->new; my $response = $robot->request(POST 'http://scores.covers.com/ajax/Spo +rtsDirect.Controls.LiveScoresControls.Scoreboard,SportsDirect.Control +s.LiveScoresControls.ashx?_method=UpdateScoreboard&_session=no', \%fi +elds); print $response->as_string;

This isn't working. It spits out the following:
HTTP/1.1 200 OK Cache-Control: private Date: Fri, 12 Mar 2010 16:04:06 GMT Content-Length: 309 Content-Type: text/html; charset=utf-8 Expires: Fri, 12 Mar 2010 16:04:06 GMT Client-Date: Fri, 12 Mar 2010 16:04:10 GMT Client-Peer: 208.68.72.130:80 Client-Response-Num: 1 X-AspNet-Version: 2.0.50727 X-Powered-By: ASP.NET new Object();r.error = new ajax_error('System.FormatException','Input +string was not in a correct format.\r\nCould not retreive parameters +from HTTP request.',0)new Object();r.error = new ajax_error('System.A +rgumentException','Object of type \'System.DBNull\' cannot be convert +ed to type \'System.Int32\'.',0)

Anyone have any ideas? If it matters, I'm on a Windows machine.

In reply to Trying to Copy Live Http Replay by sstevens

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.