in reply to Re^2: HTTP::Request::Common - Unescape some characters
in thread HTTP::Request::Common - Unescape some characters
That's very long for a URL. Most serves have a limit on the length of the URLs they can handle.
Also, your XML is invalid. You have unescaped double quotes in a double quoted attributes value, and "<" is not allowed to appear in attribute values. You need to use """ and "<". Parsers might excuse the latter, but the former will definitely result in an error.
should beTEXT="The flight # <101> "DEL" to "BLR" is ..."
TEXT="The flight # <101> "DEL" to "BLR" is ..."
But to answer your question, you can use URI to build a URL (a kind of URI).
use URI qw( ); chomp( my $data = <<'__EOI__' ); <?xml version="1.0" encoding="ISO-8859-1"?><!DOCTYPE MESSAGE SYSTEM "h +ttp://127.0.0.1/psms/dtd/message.dtd" ><MESSAGE><USER USERNAME="test" + PASSWORD="XXXXXX"/><SMS UDH="0" CODING="1" TEXT="The flight # <101> +"DEL" to "BLR" is delayed and it's revised time will be informed late +r. Have a nice day!" PROPERTY="0" ID="1"><ADDRESS FROM="ValueFirst" T +O="91XXXXXXXXXX" SEQ="1" TAG="some clientside random data" /></SMS></ +MESSAGE> __EOI__ my $url = URI->new('http://api.url/psms/servlet/psms.Eservice2'); $url->query_form( data => $data, action => 'send', ); print "$url\n";
|
|---|