java.lang.Object | |
↳ | com.pdftron.pdf.PDFViewCtrl.HTTPRequestOptions |
Class for customizing network requests.
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
HTTPRequestOptions()
Create a HTTPRequestOptions object.
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
void |
addHeader(String header, String val)
Sets a custom header to use with all requests.
| ||||||||||
void |
restrictDownloadUsage(boolean val)
Restrict download usage
| ||||||||||
void |
skipByteRangeTest(boolean skip)
By default OpenURLAsync will test the remote server's
support for byte ranges using a small GET request.
| ||||||||||
void |
useRemoteFileSize(long sizeInByte)
By default OpenURLAsync will obtain the remote file size
up front using a HEAD request.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
|
Create a HTTPRequestOptions object.
Sets a custom header to use with all requests.
header | A custom header. |
---|---|
val | The value of the custom header. |
PDFNetException | PDFNet exception |
---|
Restrict download usage
val | whether to restrict download usage |
---|
PDFNetException | PDFNet exception |
---|
By default OpenURLAsync will test the remote server's support for byte ranges using a small GET request. If you control the server and can guarantee it supports byte ranges you can skip this check to slightly improve the load performance.
Passing true to this function when the server does not support byte range requests will result in undefined behaviour and errors. Use at your own risk.
skip | Passing true will skip the byte range test. |
---|
PDFNetException | PDFNet exception |
---|
By default OpenURLAsync will obtain the remote file size up front using a HEAD request. Providing the file size with this function allows this request to be skipped, which will slightly improve the load performance.
sizeInByte | The size of the remote file in bytes. |
---|
PDFNetException | PDFNet exception |
---|