CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
Search Posts SEARCH
Who's Online WHO'S
Log in LOG

Home: Need a Custom or Prewritten Perl Program?: I Need a Programmer for Freelance Work:
Reply to: Re: Programming Consultant needed
Guest Username:
E-mail address:
Post Style:      Get Markup Help


Replying to: Re: Programming Consultant needed by Kanji

In Reply To
1) How does a browser normally prepare to POST multiple select menus and / or multiple fields with the same name attribute (eg checkboxes), and how do I emulate this when preparing the data hash for the request object?

Each value of same-name fields are reproduced in key=value fashion as if they were the only one, and then stringed together later on as you would for any other field you need to add either directly with HTTP::Request's new or content methods.

    $req = HTTP::Request->new( POST => $url ); 

Personally, I find it much easier to use HTTP::Request::Common instead, and let it build my query strings for me.

    $req = POST $url, [ 
"field" => "value1",
"field" => "value2",
"ad" => "nauseum",

In Reply To
2) How do I prepare the headers for www_authenticate or authorization?

There's a few ways, but the easist is probably using HTTP::Request's authorization_basic method.

    $req->authorization_basic( "username", "password" );

Other alternatives include tacking on an Authorization header, using LWP::UserAgent's credentials method, or overriding LWP::UserAgent's get_basic_credentials; each of which have their pros and cons.

Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives