![]() |
libgpac
Documentation of the core library of GPAC
|
HTTP request handler object.
Public Member Functions | |
| __init__ (self) | |
| Constructor. | |
| throttle (self, done, total) | |
| throttle the connection - if not overriden by subclass, not used | |
| read (self, buf, size) | |
| read data for the request - if not overriden by subclass, not used | |
| write (self, buf, size) | |
| write data for the request (PUT/POST) - if not overriden by subclass, not used | |
| close (self, reason) | |
| close callback for the request - if not overriden by subclass, not used | |
| on_request (self, method, url, auth_code, headers) | |
| callback for the request - this shoulld be overriden by subclass, default behaviour being to delegate to GPAC | |
| send (self) | |
| Send the reply to the client. | |
Data Fields | |
| int | reply = 0 |
| reply code A reply code of 0 means httpout will serve the resource as usual | |
| body = None | |
| reply body | |
| list | headers_out = [] |
| list of headers to add even values are header names, odd values are header values | |
| python.libgpac.libgpac.HTTPOutRequest.throttle | ( | self, | |
| done, | |||
| total ) |
| done | amount of bytes of ressource sent |
| total | total size of ressource |
| python.libgpac.libgpac.HTTPOutRequest.read | ( | self, | |
| buf, | |||
| size ) |
| buf | NP array (or c_ubyte pointer if no numpy support) to write data to |
| size | size of array to fill |
| python.libgpac.libgpac.HTTPOutRequest.write | ( | self, | |
| buf, | |||
| size ) |
| buf | NP array (or c_ubyte pointer if no numpy support) containing data from client |
| size | number of valid bytes in the array |
| python.libgpac.libgpac.HTTPOutRequest.close | ( | self, | |
| reason ) |
| reason | GPAC error code of the end of session |
| python.libgpac.libgpac.HTTPOutRequest.on_request | ( | self, | |
| method, | |||
| url, | |||
| auth_code, | |||
| headers ) |
| method | HTTP method used, as string |
| url | URL of the HTTP request |
| 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 |
| headers | list of headers of input request, even values are header names, odd values are header values |
| python.libgpac.libgpac.HTTPOutRequest.send | ( | self | ) |
This can be called aither upon on_request or later (asynchronously)
| python.libgpac.libgpac.HTTPOutRequest.body = None |