Skip to content

Accessing additional request and response infomation

Matija Mazi edited this page Apr 3, 2018 · 1 revision

Rescu currently supports limited access to some information in the HTTP request and response. This is achieved by making model classes (API method response types) implement InvocationAware and/or HttpResponseAware:

InvocationAware

This functionality can be used if you need access to the HTTP API method invocation information in the returned objects.

If your return type implements InvocationAware, rescu will populate the returned instance with the RestInvocation instance that carries information about the request such as the url, the HTTP method, parameter values etc.

Response-aware Exceptions

If your return type implements HttpResponseAware, rescu will populate the returned instance with HTTP response header information.