in reply to How do I shorten/encode huge GET strings?
I am not sure what you mean by shortening the GET string. If you have alot of data, a POST may be better suited.
This is what I usually do when I need to encode a hash of data to use in a GET request though.
There may be a better way to do this(of course).sub _url_encode_data { my ( $data ) = @_; my $post_string; foreach my $field ( keys %$data ) { next if ( $data->{$field} eq '' ); $data->{$field} =~ s/([^a-zA-Z0-9_\-.])/uc sprintf("%%%02x",or +d($1))/eg; $post_string .= "$field=$data->{$field}&"; } return $post_string; } # END _url_encode_data
Hope that helps though.
Wonko
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: How do I shorten/encode huge GET strings?
by Jenda (Abbot) on May 22, 2004 at 20:50 UTC | |
|
Re: Re: How do I shorten/encode huge GET strings?
by kleinbiker7 (Sexton) on May 21, 2004 at 19:18 UTC | |
by mifflin (Curate) on May 21, 2004 at 20:08 UTC | |
|
Re: Re: How do I shorten/encode huge GET strings?
by Anonymous Monk on May 22, 2004 at 03:26 UTC |