Hello,
I'd like to implement such a scenario:
So, there are two questions:
Regards
Tomasz
Hi Tomasz,
I don't quite get your scenario, so let's see if I understand: you expose a REST API, and each method has an input, which is a code. This code is sent by the consumer of the method. However, in your OutSystems code you need to convert this code to an identifier for easy later processing. You do not want to explicitly code that each time in the OutSystems code in the methods, but instead want to rely on pre-processing in OnRequest. Am I right so far?
Anyways, OnRequest, as opposed to OnBeforeRequest of a consumed REST API, is pretty spartan: you have access to the request body, and that's it. No access to headers, no access to the URL. So there's very little you can do there. Also, for GET methods you do not even have a body, as all parameters are in the URL by definition. So I'm afraid the only thing you can do is just explicitly convert the code to an Id in every method.
Hi Kilian,
Thanks for the explanations. They confirm my suspicions :-). The Outsystems' documentation is a little bit misleading - it promises too much.
Yeah, the documentation is not ideal here, and I don't understand why OnRequest doesn't have the same possibilities as OnBeforeRequest. But anyway, thanks I could be of (limited) help. Happy coding!