@Override public Response intercept(Chain chain) throws IOException {
    final Request request = chain.request();

    final Request.Builder builder = request.newBuilder()
        .addHeader(HEADER_NAME, contentType);

    if (request.body() != null) {
      rewriteBodyWithCustomContentType(request, builder);
    }

    final Request contentTypeRequest = builder.build();
    return chain.proceed(contentTypeRequest);
  }
@ Override public Response intercept ( Chain chain ) throws IOException { final Request request = chain . request ( ) ; final Request . Builder builder = request . newBuilder ( ) . addHeader ( HEADER_NAME , contentType ) ; if ( request . body ( ) != null ) { rewriteBodyWithCustomContentType ( request , builder ) ; } final Request contentTypeRequest = builder . build ( ) ; return chain . proceed ( contentTypeRequest ) ; }
Method called by framework, to enrich current request with the header information requested.

@param chain the execution chain for the request.
@return the response received
@throws IOException if chain had an error