averylongloginname has asked for the wisdom of the Perl Monks concerning the following question:

Here's the problem. I have an XML document I am trying to POST via a form to another server. This other server is expecting the content type to be 'text/xml'. So of course I set the form attribute to ENCTYPE="text/xml", but the other server is still indicating that the content type is "application/x-www-form-urlencoded" (the default value).
Here is my simple form:
<html><head></head> <title>some simple form</title> <form ENCTYPE="text/xml" action="SOME_URL" method="POST"> <input type="hidden" value='MY_XML_FORM'> <input type=submit name=submit value='SUBMIT'></form> </body> </html>
Thanks a bunch. This is driving me crazy.

Replies are listed 'Best First'.
Re: Form content-type (ENCTYPE) is not being set
by chromatic (Archbishop) on Feb 24, 2001 at 07:15 UTC
    According to HTML and XHTML, you have three options for encoding types. The first is the default, 'application/x-www-form-urlencoded'. The other two are 'multipart/form-data' and 'text/plain'.

    These don't exactly seem to correspond to MIME-types. Change your encoding type to 'text/plain' and see if that cures it.

(ichimunki) re: Form content-type (ENCTYPE) is not being set
by ichimunki (Priest) on Feb 24, 2001 at 04:47 UTC
    Not that I don't want to be helpful, but I'm not seeing how this is a Perl question. It sounds like a problem somewhere between the receiving web server and your client. Without some code, or at least more information about what architecture this is happening on, we can't really do much with the question as asked.
Re: Form content-type (ENCTYPE) is not being set
by doran (Deacon) on Feb 24, 2001 at 09:29 UTC
    What kind of server is it? A web server? If so, what brand that it requires a content type of text/xml?

    Good luck

Re: Form content-type (ENCTYPE) is not being set
by averylongloginname (Novice) on Feb 24, 2001 at 21:41 UTC
    True - this does not look much like Perl at all. Since I am writing the whole cgi script with Perl it was a natural reaction to jump to the monks when I hit a stumbling block.
    *** woops ***
    I don't know anything about the server I am trying to post to * yet *. Here's the deal - This is some large vendor that is expecting a Purchase Order from my server in the form of an XML document. The large vendor is responsible for the documentation that explains how to interact with it and only says, "POST your XML document to our server". I talked to a rep there the other day and no one knows anything about perl, then one CGI guy there says, "oh, you need to encode it with text/xml". He goes on to say that most people use ASP for implimentation....yucchh. So I'm guessing what's happening is that my XML doc is encoded with the default style ('application/x-www-form-urlencoded') and arrives at the server encoded (so the server does not know that it is XML). Oh well - I'll start hitting some HTML boards. thanks.
Re: Form content-type (ENCTYPE) is not being set
by SilverB1rd (Scribe) on Feb 24, 2001 at 03:03 UTC
    From what it looks like I dont know why your trying to use XML? All the stuff you have looks like HTML.
    Try putting the enctype after method.

    UPDATE As noted below what does this have to do with perl?

    ------
    Price of Freedom is Eternal Vigilance
      The order of attributes in an SGML-derivative markup language (XML or HTML) should not matter, at least in a standards-compliant client-- changing the order should not have an affect, and if it does, this would be a bug.