Removing url encoding from XML POST requests

Discussion in 'Perl' started by Eric, Sep 21, 2004.

  1. Eric

    Eric Guest

    Hi,

    I was sure I would be able to find some info about this in the LWP
    archives but I have had no luck. I also can't seem to tell if the
    libwwww Perl mailing list is alive or not.


    my $ua = LWP::UserAgent->new();
    push @{ $ua->requests_redirectable }, 'POST';

    my $utf_account_header = encode("utf8", $account_header);
    my $req = POST $self->{posturl},[$utf_account_header];
    $req->header('Content-Type' => 'text/xml; charset=UTF-8');
    my $res = $ua->request($req);


    I am not sure if the utf encoding is nessicary, but from what I read in
    the HTTP::Request manpage it is. "Note that the content should be a
    string of bytes. Strings in perl
    can contain characters outside the range of a byte. The Encode
    module can be used to turn such strings into a string of bytes."


    But where I want to send,
    <PAYZIP_XML>
    <REQUEST>

    I get

    User-Agent: libwww-perl/5.79
    Content-Length: 728
    Content-Type: text/xml; charset=UTF-8

    %3CPAYZIP_XML%3E%0A++%3CREQUEST%3E%0A++++
    (I cut out some bad to post info)



    I know for certain the server does not expect to get url encoding, I
    don't know why the hell they could not have just decided to check for it
    though! :) I tested that using the POST script and was able to get a
    correct response with it.

    So can someone tell me how to specify that I am sending the exact
    content I want to send and not to encode it?


    Thanks,

    Eric
     
    Eric, Sep 21, 2004
    #1
    1. Advertisements

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. GhislainTanguay
    Replies:
    3
    Views:
    6,504
    Joe Reazor
    May 21, 2004
  2. Jon paugh
    Replies:
    1
    Views:
    1,372
  3. Fernando Arámburu

    web requests and mobile requests

    Fernando Arámburu, Apr 8, 2005, in forum: ASP .Net
    Replies:
    1
    Views:
    638
    Joerg Jooss
    Apr 8, 2005
  4. Replies:
    2
    Views:
    1,424
    Tom Regner
    Jul 15, 2004
  5. Chris  Chiasson
    Replies:
    6
    Views:
    844
    Richard Tobin
    Nov 14, 2006
  6. Martin
    Replies:
    0
    Views:
    1,436
    Martin
    Apr 28, 2010
  7. Just D.
    Replies:
    0
    Views:
    836
    Just D.
    Aug 11, 2004
  8. Replies:
    3
    Views:
    223
Loading...