Skip to content

Commit

Permalink
Add documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
kelunik committed Nov 20, 2019
1 parent 76adbc2 commit 3f42e2b
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/ApplicationInterceptor.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
namespace Amp\Http\Client;

use Amp\CancellationToken;
use Amp\Http\Client\Interceptor\DecompressResponse;
use Amp\Promise;

/**
Expand All @@ -18,6 +19,12 @@ interface ApplicationInterceptor
*
* An interceptor might also short-circuit and not delegate to the `$httpClient` at all.
*
* Any retry or cloned follow-up request must be manually cloned from `$request` to ensure a properly working
* interceptor chain, e.g. the {@see DecompressResponse} interceptor only decodes a response if the
* `accept-encoding` header isn't set manually. If the request isn't cloned, the first attempt will set the header
* and the second attempt will see the header and won't decode the response, because it thinks another interceptor
* or the application itself will care about the decoding.
*
* @param Request $request
* @param CancellationToken $cancellation
* @param DelegateHttpClient $httpClient
Expand Down

0 comments on commit 3f42e2b

Please sign in to comment.