0

I have a REST extension and I have beeing accessing the parameters that have been passed, both in GET and POST as follows.. The parameters are passed as form-data or x-www-form-urlencoded. In my REST extension I would access the parameters via xdmp:get-request-field("remoteURL").

In ML-8, this worked where in when calling the WS I would pass in the parameters as remoteURL and it worked..

Now in ML-9.0-3, it does not work, so I tried passing the parameters via rs:remoteURL and access in the REST extension as xdmp:get-request-field("remoteURL") and it fails, but when I access as xdmp:get-request-field("rs:remoteURL"). it works.. Did this got changed in ML-9.0-3 ?

Just for complete I am including my REST extension code as well

declare function repoTest:post($context as map:map, $params  as map:map,$input   as document-node()*) as document-node()*
{
  let $_ := xdmp:log("Inside the Repo Test POST")
  let $remoteURL :=xdmp:get-request-field("remoteURL")
  let $_ := xdmp:log($remoteURL)
  let $output := json:object()
  let $_ :=  map:put($output, "remoteURL", $remoteURL)
  return document { xdmp:to-json($output) }
};

2 Answers 2

1

The documented approach has always been to use the rs: prefix for user-defined parameters.

If parameters without the prefix were provided to the extension, that was unexpected.

Hoping that clarifies,

Sign up to request clarification or add additional context in comments.

Comments

0

I am not aware of a change in this, though it could be very well possible. I'd recommend accessing parameters via the $params map:map, which is the recommended way for REST extensions anyhow. $params will always contains any rs: request parameters without the rs: prefix.

HTH!

2 Comments

Can I use map params to get the binary content and filename etc
I never tried to be honest. I suspect currently not. At least not with form-data. I think it should be able to handle multipart/mixed though.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.