[MarkLogic Dev General] Content-Type, xdmp:get-request-field() and xdmp:get-request-body()

Wyatt marklogic at wylovan.com
Mon Dec 18 13:25:21 PST 2006


I'm running into a problem using xdmp:get-request-field() with POST 
requests...

According to the xdmp:get-request-body() documentation:
"If the content-type of the POST body is 
application/x-www-form-urlencoded, it is not available here, but instead 
is available in its decoded form through xdmp:get-request-field-names() 
and xdmp:get-request-field()."

I've trying to upgrade to the latest (1.5.0_rc2) Prototype Framework 
(http://prototype.conio.net), and they now add a charset parameter to 
the Content-Type header field...

     application/x-www-form-urlencoded; charset=UTF-8

This changes how MLS interprets the Content-Type and the data is only 
available via xdmp:get-request-body().  I'd much rather MLS know that 
this if form data, parse it, and make it available via 
xdmp:get-request-field().  This means no changes to my XQuery code.

My question is whether this is a short-coming of MLS that is likely to 
change, in which case I can hack the Javascript and leave my XQueries 
alone, or if this is intentional and I should update my XQueries to use 
xdmp:get-request-body() and parse the body data?

Thanks to anyone with guidance on this issue.

Wyatt





More information about the General mailing list