Posted Fri, 05 Dec 2014 08:36:42 GMT in reply to
Xavier Bigand
Reply
On Mon, 01 Dec 2014 22:02:08 GMT, Xavier Bigand wrote:
Hi,
I am looking for a way to retrieve the ip of clients, when they call a rest service.
It seems to be not supported to have a HTTPServerRequest parameter on a rest method.
Maybe I need prefer form interfaces? What are the differences with rest ones?
For the differences:
https://github.com/rejectedsoftware/vibe.d/pull/842#issuecomment-56690175
Should I have to do it, I would use @before:
https://github.com/rejectedsoftware/vibe.d/blob/master/examples/rest/source/app.d#L289
Note however that @before has some problems, and it's a workaround which works only for trivial issues (e.g., avoid as much as possible server code / types in @before, as the function referenced has to be visible from the client too).