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

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Need a Custom or Prewritten Perl Program?: I Need a Programmer for Freelance Work:
Programming Consultant needed

 



kencl
User

Aug 24, 2001, 1:29 PM

Post #1 of 2 (3824 views)
Programming Consultant needed Quote | Reply | Private Reply

Hi Folks,

I've been contracted to develop a multi-website posting engine. I'd like to find a consultant familiar with mod_perl / Apache::Perlrun, LWP::UserAgent and HTTP POST operations. I'll be doing the programming, but would like someone to review my code and answer some specific questions. Here are a couple of typical questions:

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? IE is there a specific delimiter, do I just append all selected fields into a single string or is there some way to construct multiple values with the same key in the request object?

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

I may also ask you to review my database schema (MySQL).

If you're interested, please e-mail me directly at kencl@home.com to discuss this further. Thanks.

>> If you can't control it, improve it, correlate it or disseminate it with PERL, it doesn't exist!


Kanji
User / Moderator

Aug 25, 2001, 6:19 PM

Post #2 of 2 (3808 views)
Re: Programming Consultant needed [In reply to] Quote | Reply | Private Reply


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.


Code
    $req = HTTP::Request->new( POST => $url ); 
$req->content("field=value1&field=value2&ad=nauseum");

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


Code
    $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.


Code
    $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