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. Advertising

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. Fernando Arámburu

    web requests and mobile requests

    Fernando Arámburu, Apr 8, 2005, in forum: ASP .Net
    Replies:
    1
    Views:
    427
    Joerg Jooss
    Apr 8, 2005
  2. jonathan Cook

    Post Requests in java servlet

    jonathan Cook, Jul 26, 2004, in forum: Java
    Replies:
    1
    Views:
    565
    Oscar kind
    Jul 26, 2004
  3. Replies:
    1
    Views:
    3,645
    Andrew Thompson
    Dec 29, 2004
  4. Chris  Chiasson
    Replies:
    6
    Views:
    596
    Richard Tobin
    Nov 14, 2006
  5. Martin
    Replies:
    0
    Views:
    1,200
    Martin
    Apr 28, 2010
Loading...

Share This Page