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]requestA PP_Resource corresponding to a URLRequestInfo.
[in]dataA pointer to a buffer holding the data.
[in]lenThe 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]requestA PP_Resource corresponding to a URLRequestInfo.
[in]file_refA PP_Resource corresponding to a file reference.
[in]start_offsetAn optional starting point offset within the file.
[in]number_of_bytesAn 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_timeAn 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.
Returns:
PP_TRUE if successful, PP_FALSE if any of the parameters are invalid.

Create() creates a new URLRequestInfo object.

Parameters:
[in]instanceA PP_Instance identifying one instance of a module.
Returns:
A PP_Resource identifying the URLRequestInfo if successful, 0 if the instance is invalid.

IsURLRequestInfo() determines if a resource is a URLRequestInfo.

Parameters:
[in]resourceA PP_Resource corresponding to a URLRequestInfo.
Returns:
PP_TRUE if the resource is a URLRequestInfo, PP_FALSE if the resource is invalid or some type other than URLRequestInfo.

SetProperty() sets a request property.

The value of the property must be the correct type according to the property being set.

Parameters:
[in]requestA PP_Resource corresponding to a URLRequestInfo.
[in]propertyA PP_URLRequestProperty identifying the property to set.
[in]valueA 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:
This site uses cookies to deliver and enhance the quality of its services and to analyze traffic. If you agree, cookies are also used to serve advertising and to personalize the content and advertisements that you see. Learn more about our use of cookies.