petesmiley has asked for the wisdom of the Perl Monks concerning the following question:

What is the easiest way to encode parameters for a http get request? I've been looking for a method in a module to do it, but everything seems to be more concerned with post requests. As much as I would love to write a hex encode tool for requests, I would rather use a module.

Replies are listed 'Best First'.
(bbfu) (URI::Escape) Re: encode get request parameters
by bbfu (Curate) on Sep 06, 2001 at 20:12 UTC

    Check out URI::Escape, which is included as a part of the URI package (a standard package; ie, you probably already have it installed).

    bbfu
    Seasons don't fear The Reaper.
    Nor do the wind, the sun, and the rain.
    We can be like they are.

      Thanks, I found Enurl but it isn't included, just hacked it up for my own use. I don't have root access to this computer. URI::Escape is already installed, so I'll use it. :)
Re: encode get request parameters
by jlongino (Parson) on Sep 06, 2001 at 20:44 UTC
    I imagine the encoding should work regardless of the GET/POST method (depending on what your're trying to do) but if you are not familiar with the characteristics and differences between the two, I seem to remember Ovid posting some good info in response to POST vs GET & their intermingling.

    Also, in Perl Cookbook in chapter 19: CGI Programming, they have an excellent discussion on the topic.

    @a=split??,'just lose the ego and get involved!';
    for(split??,'afqtw{|~'){print $a[ord($_)-97]}