java - OkHttp的Application Interceptors和Network Interceptors具体区别是?
PHPz
PHPz 2017-04-17 15:46:21
0
0
444

Choosing between application and network interceptors

Each interceptor chain has relative merits.

Application interceptors

  • Don't need to worry about intermediate responses like redirects and retries.

  • Are always invoked once, even if the HTTP response is served from the cache.

  • Observe the application's original intent. Unconcerned with OkHttp-injected headers like If-None-Match.

  • Permitted to short-circuit and not call Chain.proceed().

  • Permitted to retry and make multiple calls to Chain.proceed().

Network Interceptors

  • Able to operate on intermediate responses like redirects and retries.

  • Not invoked for cached responses that short-circuit the network.

  • Observe the data just as it will be transmitted over the network.

  • Access to the Connection that carries the request.

理解的不是很透彻,希望大神解答

PHPz
PHPz

学习是最好的投资!

全員に返信 (0)
最新のダウンロード
詳細>
ウェブエフェクト
公式サイト
サイト素材
フロントエンドテンプレート
私たちについて 免責事項 Sitemap
PHP中国語ウェブサイト:福祉オンライン PHP トレーニング,PHP 学習者の迅速な成長を支援します!