REST - scope of callback OnBeforeRequest

REST - scope of callback OnBeforeRequest

  

Inside the callback OnBeforeRequest web have access to informations like the HTTPRequest and HTTResponse.

These informations are accessed only inside the callback action, and since we do not put the callback explicitly inside the logical flow, how to use these informations outside the CallBack Action .

My need : I need to get the HTTP response code and use it outside the callback action.


Thanks


Hi,

So, you want to use the http RESPONSE code returned by the consumed web service method you executed?

In this case you want to use the OnAfterResponse method.

As you have access to the json returned, you can add the http response code to it, adding the attribute in the output structure to have access to it outside.

Cheers

I want to use both the Response and and status code (200, 403, etc ) .

These are available only inside the OnAfterResponse, it looks like an isolated scope.