![]() |
libgpac
Documentation of the core library of GPAC
|
JSHTTPRequest API. More...
import"httpout.idl";
Public Member Functions | |
attribute void | send () |
attribute DOMString body attribute signed long | throttle (unsigned long long done, unsigned long long total) |
attribute signed long | read (ArrayBuffer buffer) |
attribute void | write (ArrayBuffer buffer) |
attribute void | close (unsigned long error) |
Data Fields | |
attribute unsigned long | reply |
attribute readonly DOMString | method |
attribute readonly DOMString | url |
attribute readonly unsigned long | auth_code |
attribute readonly Array | headers_in |
attribute Array | headers_out |
JSHTTPRequest API.
The JSHTTPRequest object provides an interface to the HTTP request being processed.
attribute void JSHTTPRequest::send | ( | ) |
send the response to the request
attribute DOMString body attribute signed long JSHTTPRequest::throttle | ( | unsigned long long | done, |
unsigned long long | total | ||
) |
reply body. It is undefined by default
callback function used to throttle the download, can be used even if the request is handled by gpac. It is set to null by default
done | amount of bytes already sent in request |
total | total amount of bytes in request |
attribute signed long JSHTTPRequest::read | ( | ArrayBuffer | buffer | ) |
callback function used to get data (GET requests). It is set to null by default
buffer | array buffer to fill (shared array, do NOT keep) |
attribute void JSHTTPRequest::write | ( | ArrayBuffer | buffer | ) |
callback function used to receive data (PUT/POST requests). It is set to null by default
buffer | array buffer received. If null, end of stream is reached |
attribute void JSHTTPRequest::close | ( | unsigned long | error | ) |
callback function used to monitor end of session. It is set to null by default
error | GPAC error code for the session. If 1 (GF_EOS), the session is ended but underlying network is kept alive, otherwise session is destroyed |
attribute unsigned long JSHTTPRequest::reply |
HTTP reply code to use. If 0, the request is handled by GPAC as usual. Otherwise, the request is handled by your script if the reply does not indicate an error
attribute readonly DOMString JSHTTPRequest::method |
HTTP method of the request
attribute readonly DOMString JSHTTPRequest::url |
HTTP URL of the request
attribute readonly unsigned long JSHTTPRequest::auth_code |
Authentication reply code - requests are pre-identified using GPAC credentials: a value of 401 indicates no identification, 200 indicates identification OK, 403 indicates failure
attribute readonly Array JSHTTPRequest::headers_in |
HTTP headers of the request, array of JSHTTPHeader objects
attribute Array JSHTTPRequest::headers_out |
HTTP headers to set on the response, array of JSHTTPHeader objects (initialized as empty)