in reply to Re^4: A regexp from paypal
in thread A regexp from paypal

Unless I'm way off base, you should be able to set the param you need using CGI, after which it will be part of the object you send in your request.

Replies are listed 'Best First'.
Re^6: A regexp from paypal
by Anonymous Monk on Nov 26, 2007 at 03:52 UTC
    I have set the param before using $q->param(-name=>,-value=>) and then sending the object off in my LWP request. This doesn't work and I'm guessing it is because it is simple a perl hash and would show up in the content of the request as HASH(x010101) or whatever, not as a POST request with the name=value pairs. Is that correct?
      Take a look at HTTP::Request::Common.

      When you create your HTTP::Request object, instead of:
      $req = new HTTP::Request 'POST','http://www.eliteweaver.co.uk/testing/ipntest.php';

      Put your parameter hash in as the third argument (after you've added your new param):
      $req = new HTTP::Request 'POST','http://www.eliteweaver.co.uk/testing/ipntest.php',$q->Vars;

      You can then delete the next two lines,

      $req->content_type('application/x-www-form-urlencoded'); $req->content($q);
      as the content is set in the constructor, and the correct content_type is set by default.
        That doesn't seem to work either, I think it is looking for the string as it is received by my program with the addition of the cmd variable. I will just create the CGI object later on when I process the variables.
        use strict; use CGI;