Topic: HOW TO Injecting params to all calls to RESTful Api?
There are both ASP.Net Core & ASP.Net MVC5 sites that are calling restful services which all require two tokens for audit purposes: token1, token2. Here is an example of the
public interface ItemApi
GetItemResponse GetItem (int itemId, int token1, string token2);
The developer making the call should not be concerned with the values of token1/token2. While it is possible for the developer to always set them, the goal is to find a way to have the infrastructure set the values for the developer.
One idea is to introduce an interceptor to set the values before the actual call is made. After reading through all the documentation on Castle Windsor's Dynamic Proxy and Dora, it appears that the method the interceptor is working on must be annotated. Annotation is not an option because the interface is autogenerated from the OpenAPI Tool. Is there a way to use interceptors without annotations?
Is there any other way to insert params into each call to given RESTful services?