@ApiStatus.Experimental
public interface RequestListener
This monitors both Request and Response bodies.
Created by covers1624 on 29/1/24.
| Modifier and Type | Interface and Description |
|---|---|
static class |
RequestListener.Direction |
| Modifier and Type | Method and Description |
|---|---|
void |
end()
Called when the transfer is complete.
|
void |
onDownload(long total,
long now)
Called with progress data on the response body download.
|
void |
onUpload(long total,
long now)
Called with progress data on the request body upload.
|
void |
start(RequestListener.Direction type)
The primary direction of this request.
|
void start(RequestListener.Direction type)
At the moment, this is UPLOAD if the request has a body, otherwise DOWNLOAD.
type - The request direction.void onUpload(long total,
long now)
total - The total expected. May be -1 if the total is unknown.now - The current value.void onDownload(long total,
long now)
total - The total expected. May be -1 if the total is unknown.now - The current value.void end()