This simple-looking method is where we signal that we want to hit our application code, producing a response to satisfy the request. It is important to note that a critical part of every interceptor’s implementation is the call to chain.proceed(request). Then we can go ahead and override this method with our own implementation.įirst, we get the incoming request by called chain.request() before printing out the headers and request URL. Public class SimpleLoggingInterceptor implements Interceptor ", request.headers(), request.url()) Īs we can see, to create our interceptor, all we need to is inherit from the Interceptor interface, which has one mandatory method intercept(Chain chain).
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |