[TinyOWS-dev] Content-type in a WFS post request
Normand Savard
nsavard at mapgears.com
Fri Nov 7 11:46:13 EST 2008
I noticed that tinyows accepts only "text/xml" as content-type. Tinyows
rejects "application/xml; charset=UTF-8" content-type. I'm wondering
why this is the case. I googled a little bit and cannot find a clear
answer. Can someone shed some light on this?
Norm
The relevant code is:
/* GET could only handle KVP */
if (cgi_method_get()) o->cgi = cgi_parse_kvp(o, query);
/* POST could handle KVP or XML encoding */
else if (cgi_method_post()) {
if (strcmp(getenv("CONTENT_TYPE"),
"application/x-www-form-urlencoded") == 0)
o->cgi = cgi_parse_kvp(o, query);
else if (strcmp(getenv("CONTENT_TYPE"), "text/xml") == 0)
o->cgi = cgi_parse_xml(o, query);
#if OWS_BUGGY_CITE_TEST
/* TODO report this bug to OGC CITE */
else if (strcmp(getenv("CONTENT_TYPE"),
"application/xml; charset=UTF-8") == 0)
o->cgi = cgi_parse_xml(o, query);
#endif
/* Unit Test case with XML values (not HTTP) */
} else if (!cgi_method_post() && !cgi_method_get() && query[0] == '<')
o->cgi = cgi_parse_xml(o, query);
else ows_error(o, OWS_ERROR_REQUEST_HTTP,
"Wrong HTTP request Method", "http");
More information about the TinyOWS-dev
mailing list