LWP::UserAgent post to post other than 80

Discussion in 'Perl Misc' started by Zapanaz, Oct 12, 2005.

  1. Zapanaz

    Zapanaz Guest

    What I am trying to do is post to a cgi script.

    The way I am doing it is this:

    my $ua = LWP::UserAgent->new();
    my $response =
    $ua->post("http://1.2.3.4:7775/cgi-local/fm_account.cgi");

    where the IP address is a real one and not 1.2.3.4

    I know the URL is valid, I can hit it in a web browser, when the code
    runs though it hangs.

    There are a lot of things that could be going wrong, but one thing I
    am not sure of is if I can specify server:port like that with
    UserAgent. Should that work? That is, if I am using http, is it
    going to assume port 80, and fail to work correctly if it isn't?

    Thanks for any help.



    --
    Zapanaz
    International Satanic Conspiracy
    Customer Support Specialist
    http://joecosby.com/
    The victim was pregnant by seeing her picture on a website
    featuring her dogs for sale.
     
    Zapanaz, Oct 12, 2005
    #1
    1. Advertising

  2. Zapanaz <http://joecosby.com/code/mail.pl> wrote:

    >
    > What I am trying to do is post to a cgi script.
    >
    > The way I am doing it is this:
    >
    > my $ua = LWP::UserAgent->new();
    > my $response =
    > $ua->post("http://1.2.3.4:7775/cgi-local/fm_account.cgi");
    >
    > where the IP address is a real one and not 1.2.3.4
    >
    > I know the URL is valid, I can hit it in a web browser, when the code
    > runs though it hangs.
    >
    > There are a lot of things that could be going wrong, but one thing I
    > am not sure of is if I can specify server:port like that with
    > UserAgent. Should that work? That is, if I am using http, is it
    > going to assume port 80, and fail to work correctly if it isn't?
    >
    > Thanks for any help.


    That should work. The problem could be with cookies, basic authentication,
    or http_referrer.
    For testing try wget with the URL.

    gtoomey
     
    Gregory Toomey, Oct 12, 2005
    #2
    1. Advertising

  3. Zapanaz <> wrote:

    > I know the URL is valid, I can hit it in a web browser, when the code
    > runs though it hangs.
    >
    > There are a lot of things that could be going wrong,



    This may help to uncover some of those things:

    Web Scraping Proxy

    http://www.research.att.com/~hpk/wsp/


    --
    Tad McClellan SGML consulting
    Perl programming
    Fort Worth, Texas
     
    Tad McClellan, Oct 12, 2005
    #3
  4. Zapanaz

    John Bokma Guest

    John Bokma, Oct 12, 2005
    #4
  5. John Bokma <> wrote:
    > Tad McClellan <> wrote:
    >
    >> http://www.research.att.com/~hpk/wsp/

    >
    > Thanks!



    You're welcome.

    I have dozens of web scrapers in use, I run the wsp often. :)


    --
    Tad McClellan SGML consulting
    Perl programming
    Fort Worth, Texas
     
    Tad McClellan, Oct 12, 2005
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. La Jesus
    Replies:
    9
    Views:
    1,339
    Gunnar Hjalmarsson
    Oct 27, 2003
  2. Chandra

    Problem with LWP::USERAGENT

    Chandra, Feb 25, 2004, in forum: Perl
    Replies:
    0
    Views:
    510
    Chandra
    Feb 25, 2004
  3. Vinay Gupta
    Replies:
    2
    Views:
    1,125
    Michael Schlenker
    Jul 27, 2004
  4. Rubel Kanubel

    Post radiobuttons (forms) using lwp-useragent

    Rubel Kanubel, Oct 12, 2003, in forum: Perl Misc
    Replies:
    5
    Views:
    244
    Anno Siegel
    Oct 13, 2003
  5. Andrew
    Replies:
    1
    Views:
    380
    Gunnar Hjalmarsson
    Dec 5, 2003
Loading...

Share This Page