Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation

comment on

( #3333=superdoc: print w/replies, xml ) Need Help??
Good evening,

I am attempting to communicate directly to a server to test ajax responses. I have attempted using mozilla::mechanize and selenium however due to errors they dont run.

I need to mimic the following post with variations to the url. I am using WWW::Mechanize as it handles the cookies and other interactions that i am doing very well.

Http Header Capture

http://[ADDRESS]/fbjs_ajax_proxy.php POST /fbjs_ajax_proxy.php HTTP/1.1 Host: [ADDRESS] User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv: Gecko +/20071204 Ubuntu/7.10 (gutsy) Firefox/ Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9 +,text/plain;q=0.8,image/png,*/*;q=0.5 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: 300 Connection: keep-alive Content-Type: application/x-www-form-urlencoded Referer: http://[ADDRESS]/Profile.php?uid=[IDNUM] Content-Length: 889 Cookie: c_user=227302802; sid=2; __utma=87286159.462992557.1198733524. +1198820048.1198836479.9; xs=99ba8adfbde7929b813ade803a0b797f; G6X9=2- +2-061F577DD020161F5618F04BC46C536DA6F6D020489A14211B78600B73C43527-F3 +A883B35D6CD6D9F582182CF2FB69666221D9F5D2BE2BD79EAA2E5A389C58A5; login +_x=227302802; __utmz=87286159.1198836479.9.8.utmccn=(referral)|utmcsr|utmcct=/profile.php|utmcmd=referral; made_write +_conn=1198836470; isfbe=false; __utmb=87286159; __utmc=87286159 Pragma: no-cache Cache-Control: no-cache url=http%3A%2F%2F[IP ADDRESS]%2FpostComments.php%3Fuid%3D227302802%26h +erd%3D&query%5Bcomment%5D=text%20messages%20are%20cool&query%5Bcomman +d%5D=&post_form_id=134f8cf869f0852535eb9c362517960b&type=2&require_lo +gin=true&fb_mockajax_context=O%3A16%3A%22CanvasFBMLFlavor%22%3A1%3A%7 +Bs%3A9%3A%22_fbml_env%22%3Ba%3A8%3A%7Bs%3A4%3A%22user%22%3Bi%3A227302 +802%3Bs%3A6%3A%22app_id%22%3Bs%3A10%3A%222437228683%22%3Bs%3A10%3A%22 +fb_page_id%22%3Bi%3A0%3Bs%3A14%3A%22unfiltered_css%22%3Bb%3A0%3Bs%3A1 +0%3A%22canvas_url%22%3Bs%3A66%3A%22http%3A%2F%2F[reffered url]%2FProf +ile.php%3Fuid%3D[IDNUM]%22%3Bs%3A10%3A%22source_url%22%3Bs%3A70%3A%22 +http%3A%2F%2F[IP ADDRESS]%2FProfile.php%3Fuid%3D[IDNUM]%22%3Bs%3A9%3A +%22loggedout%22%3Bb%3A0%3Bs%3A7%3A%22non-tos%22%3Bb%3A0%3B%7D%7D&fb_m +ockajax_context_hash=f1247ab4b99b&appid=2437228683

I was looking at LWP::UserAgent as it is a part of the WWW::Mechanize->request(). Is this possible? The documentation doesn't touch on this in the ways id like it to. Any guidance would be awsome, especially examples (like with the header i provided)

Thank you for reading and to those who help!

In reply to Communicating to AJAX by zer

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

  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or or How to display code and escape characters are good places to start.
Log In?

What's my password?
Create A New User
Domain Nodelet?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (5)
As of 2022-09-30 07:27 GMT
Find Nodes?
    Voting Booth?
    I prefer my indexes to start at:

    Results (125 votes). Check out past polls.