Skip to content

Commit

Permalink
Update interceptor docs for response body behaviour (square#5310)
Browse files Browse the repository at this point in the history
  • Loading branch information
jjestrel authored and yschimke committed Jul 30, 2019
1 parent 77a2a38 commit 0b3193d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion docs/interceptors.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class LoggingInterceptor implements Interceptor {
}
```

A call to `chain.proceed(request)` is a critical part of each interceptor’s implementation. This simple-looking method is where all the HTTP work happens, producing a response to satisfy the request.
A call to `chain.proceed(request)` is a critical part of each interceptor’s implementation. This simple-looking method is where all the HTTP work happens, producing a response to satisfy the request. If `chain.proceed(request)` is being called more than once previous response bodies must be closed.

Interceptors can be chained. Suppose you have both a compressing interceptor and a checksumming interceptor: you'll need to decide whether data is compressed and then checksummed, or checksummed and then compressed. OkHttp uses lists to track interceptors, and interceptors are called in order.

Expand Down

0 comments on commit 0b3193d

Please sign in to comment.