Class HeaderInterceptor

    • Nested Class Summary

      • Nested classes/interfaces inherited from interface okhttp3.Interceptor

        okhttp3.Interceptor.Chain
    • Constructor Summary

      Constructors 
      Constructor Description
      HeaderInterceptor​(java.lang.String name, java.lang.String value)
      Create an arbitrary header adding interceptor.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String getName()  
      java.lang.String getValue()  
      okhttp3.Response intercept​(okhttp3.Interceptor.Chain chain)
      Method called by framework, to enrich current request chain with the header information requested.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • HeaderInterceptor

        public HeaderInterceptor​(java.lang.String name,
                                 java.lang.String value)
        Create an arbitrary header adding interceptor.
        Parameters:
        name - of the header to be used.
        value - value of the new header.
    • Method Detail

      • intercept

        public okhttp3.Response intercept​(okhttp3.Interceptor.Chain chain)
                                   throws java.io.IOException
        Method called by framework, to enrich current request chain with the header information requested.
        Specified by:
        intercept in interface okhttp3.Interceptor
        Parameters:
        chain - the execution chain for the request.
        Returns:
        the response received.
        Throws:
        java.io.IOException - in case of failure down the line.
      • getName

        public java.lang.String getName()
        Returns:
        the name of this header.
      • getValue

        public java.lang.String getValue()
        Returns:
        the value of this header.