in reply to CGI.pm problems

I've been using XML posting through LWP for a couple of projects and another (albeit less elegant but much easier) way around it is to let it be a regular HTTP post and pull the xml from from CGI::param (i.e. $query->param ('xml');).

Another thing I noticed: you 'use CGI;', but you never actually call it anywhere in the code, right? Could just the using of CGI.pm be causing some of your lossage?

Replies are listed 'Best First'.
Re: Re: CGI.pm problems
by c-era (Curate) on Dec 13, 2001 at 22:29 UTC
    The problem with using $query->param('xml') is, they can't send an xml= infront of the xml, the second problem is &; will appear frequently in the xml (which is where I'm losing the data with cgi.pm).

    As for the use CGI; I just didn't remove it from the example. It makes no difference if I remove it.

      According to a reference here, the ampersand must be converted into an entity in element content. Change that to &; and it'll be more valid. (Think of it this way -- if bare ampersands were allowed, how would you be able to find entities?)

      I suspect that may have a dramatic effect on how CGI.pm works.

        They can't send the data that way (the program they are using is hard coded). It's not suppost to be form data, but they aren't sending it as a multitype, so it comes across as form data.
      As for the use CGI; I just didn't remove it from the example. It makes no difference if I remove it.

      So this is the "roll-your-own" version? Why didn't you post the CGI.pm version that you're having trouble with? If you want help fixing your CGI.pm code, you will have to actually post it for people to look at.

        That's the problem, I don't even know where to start with using the cgi.pm stuff. Look at the agent I wrote and how it produces its output. Because there is no key-value pair, I can't use param().