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 "&quot;" and "&lt;". Parsers might excuse the latter, but the former will definitely result in an error.

TEXT="The flight # <101> "DEL" to "BLR" is ..."
should be
TEXT="The flight # &lt;101> &quot;DEL&quot; to &quot;BLR&quot; 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";

In reply to Re^3: HTTP::Request::Common - Unescape some characters by ikegami
in thread HTTP::Request::Common - Unescape some characters by ejaincom

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.