I created a REST service, is it possible inside one method see who did the call (url or something)

Hey Filipe,

By "inside one method" do you mean inside the REST service method?  And by "who did the call", you can always add input parameters to the method if you need additional context.  A web request will always have a remote IP, but you would only be able to get the referring URL header if one was passed to it by a browser, which will not help if the service is called by any other method.

Craig St.Jean wrote:

Hey Filipe,

By "inside one method" do you mean inside the REST service method?  And by "who did the call", you can always add input parameters to the method if you need additional context.  A web request will always have a remote IP, but you would only be able to get the referring URL header if one was passed to it by a browser, which will not help if the service is called by any other method.

By "inside one method" do you mean inside the REST service method? Yes

And by "who did the call", you can always add input parameters to the method if you need additional context

Yes but i dont want to add extra dummy parameters just to get that.

In this case is by one internal application so i have always a requester even if the call is made by javascript


Is the JavaScript call a part of the same application?  If not, I would suggest adding a username header or something that you can then retrieve in the REST service.  Or, if you want the referrer URL you can use GetRequestHeader from HTTPRequestHandler and pull the value of the referer header (yes it is misspelled, but that is how the web standard has it).

Or am I misunderstanding?

Craig St.Jean wrote:

Is the JavaScript call a part of the same application?  If not, I would suggest adding a username header or something that you can then retrieve in the REST service.  Or, if you want the referrer URL you can use GetRequestHeader from HTTPRequestHandler and pull the value of the referer header (yes it is misspelled, but that is how the web standard has it).

Or am I misunderstanding?

Is the JavaScript call a part of the same application? Yes