Data Fields
PP_Resource(* | Create )(PP_Instance instance) |
PP_Bool(* | IsURLRequestInfo )(PP_Resource resource) |
PP_Bool(* | SetProperty )(PP_Resource request, PP_URLRequestProperty property, struct PP_Var value) |
PP_Bool(* | AppendDataToBody )(PP_Resource request, const void *data, uint32_t len) |
PP_Bool(* | AppendFileToBody )(PP_Resource request, PP_Resource file_ref, int64_t start_offset, int64_t number_of_bytes, PP_Time expected_last_modified_time) |
Detailed Description
The PPB_URLRequestInfo
interface is used to create and handle URL requests.
This API is used in conjunction with PPB_URLLoader
. Refer to PPB_URLLoader
for further information.
Field Documentation
PP_Bool(* PPB_URLRequestInfo::AppendDataToBody)(PP_Resource request, const void *data, uint32_t len) |
AppendDataToBody() appends data to the request body.
A Content-Length request header will be automatically generated.
- Parameters:
[in] request A PP_Resource
corresponding to aURLRequestInfo
.[in] data A pointer to a buffer holding the data. [in] len The length, in bytes, of the data.
- Returns:
PP_TRUE
if successful,PP_FALSE
if any of the parameters are invalid.
PP_Bool(* PPB_URLRequestInfo::AppendFileToBody)(PP_Resource request, PP_Resource file_ref, int64_t start_offset, int64_t number_of_bytes, PP_Time expected_last_modified_time) |
AppendFileToBody() appends a file, to be uploaded, to the request body.
A content-length request header will be automatically generated.
- Parameters:
[in] request A PP_Resource
corresponding to aURLRequestInfo
.[in] file_ref A PP_Resource
corresponding to a file reference.[in] start_offset An optional starting point offset within the file. [in] number_of_bytes An optional number of bytes of the file to be included. If number_of_bytes
is -1, then the sub-range to upload extends to the end of the file.[in] expected_last_modified_time An optional (non-zero) last modified time stamp used to validate that the file was not modified since the given time before it was uploaded. The upload will fail with an error code of PP_ERROR_FILECHANGED
if the file has been modified since the given time. Ifexpected_last_modified_time
is 0, then no validation is performed.
- Returns:
PP_TRUE
if successful,PP_FALSE
if any of the parameters are invalid.
PP_Resource(* PPB_URLRequestInfo::Create)(PP_Instance instance) |
Create() creates a new URLRequestInfo
object.
- Parameters:
[in] instance A PP_Instance
identifying one instance of a module.
- Returns:
- A
PP_Resource
identifying theURLRequestInfo
if successful, 0 if the instance is invalid.
PP_Bool(* PPB_URLRequestInfo::IsURLRequestInfo)(PP_Resource resource) |
IsURLRequestInfo() determines if a resource is a URLRequestInfo
.
- Parameters:
[in] resource A PP_Resource
corresponding to aURLRequestInfo
.
- Returns:
PP_TRUE
if the resource is aURLRequestInfo
,PP_FALSE
if the resource is invalid or some type other thanURLRequestInfo
.
PP_Bool(* PPB_URLRequestInfo::SetProperty)(PP_Resource request, PP_URLRequestProperty property, struct PP_Var value) |
SetProperty() sets a request property.
The value of the property must be the correct type according to the property being set.
- Parameters:
[in] request A PP_Resource
corresponding to aURLRequestInfo
.[in] property A PP_URLRequestProperty
identifying the property to set.[in] value A PP_Var
containing the property value.
- Returns:
PP_TRUE
if successful,PP_FALSE
if any of the parameters are invalid.
The documentation for this struct was generated from the following file: