{{+bindTo:partials.standard_nacl_api}}
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) |
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.
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.
[in] | request | A PP_Resource corresponding to a URLRequestInfo . |
[in] | data | A pointer to a buffer holding the data. |
[in] | len | The length, in bytes, of the data. |
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.
[in] | request | A PP_Resource corresponding to a URLRequestInfo . |
[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. If expected_last_modified_time is 0, then no validation is performed. |
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.
[in] | instance | A PP_Instance identifying one instance of a module. |
PP_Resource
identifying the URLRequestInfo
if successful, 0 if the instance is invalid. PP_Bool(* PPB_URLRequestInfo::IsURLRequestInfo)(PP_Resource resource) |
IsURLRequestInfo() determines if a resource is a URLRequestInfo
.
[in] | resource | A PP_Resource corresponding to a URLRequestInfo . |
PP_TRUE
if the resource is a URLRequestInfo
, PP_FALSE
if the resource is invalid or some type other than URLRequestInfo
. 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.
[in] | request | A PP_Resource corresponding to a URLRequestInfo . |
[in] | property | A PP_URLRequestProperty identifying the property to set. |
[in] | value | A PP_Var containing the property value. |
PP_TRUE
if successful, PP_FALSE
if any of the parameters are invalid.