• Home
  • Raw
  • Download

Lines Matching full:py

4 .. py:module:: nghttp2
21 .. py:class:: HDDeflater(hd_table_bufsize_max=DEFLATE_MAX_HEADER_TABLE_SIZE)
26 :py:data:`DEFLATE_MAX_HEADER_TABLE_SIZE`. This is necessary
34 .. py:method:: deflate(headers)
42 .. py:method:: set_no_refset(no_refset)
46 invocation of :py:meth:`deflate()`, deflater will clear up
49 .. py:method:: change_table_size(hd_table_bufsize_max)
58 .. py:method:: get_hd_table()
76 .. py:class:: HDInflater()
80 .. py:method:: inflate(data)
87 .. py:method:: change_table_size(hd_table_bufsize_max)
93 .. py:method:: get_hd_table()
113 .. py:function:: print_hd_table(hdtable)
117 :py:meth:`HDDeflater.get_hd_table()` or
118 :py:meth:`HDInflater.get_hd_table()`. This function does not work
124 .. py:data:: DEFAULT_HEADER_TABLE_SIZE
129 .. py:data:: DEFLATE_MAX_HEADER_TABLE_SIZE
139 We use :py:mod:`asyncio` for HTTP/2 server classes, and ALPN.
149 .. py:class:: HTTP2Server(address, RequestHandlerClass, ssl=None)
151 This class builds on top of the :py:mod:`asyncio` event loop. On
153 subclass of :py:class:`BaseRequestHandler` class.
159 To enable SSL/TLS, specify instance of :py:class:`ssl.SSLContext`
161 :py:func:`BaseEventLoop.create_server`, ALPN protocol identifiers
162 are set using :py:meth:`ssl.SSLContext.set_npn_protocols`.
166 .. py:method:: serve_forever()
170 .. py:class:: BaseRequestHandler(http2, stream_id)
176 The first callback method invoked is :py:meth:`on_headers()`. It is
180 If request has request body, :py:meth:`on_data()` is invoked for
183 When whole request is received, :py:meth:`on_request_done()` is
186 When stream is closed, :py:meth:`on_close()` is called.
188 The application can send response using :py:meth:`send_response()`
189 method. It can be used in :py:meth:`on_headers()`,
190 :py:meth:`on_data()` or :py:meth:`on_request_done()`.
192 The application can push resource using :py:meth:`push()` method.
193 It must be used before :py:meth:`send_response()` call.
195 A :py:class:`BaseRequestHandler` has the following instance
198 .. py:attribute:: client_address
203 .. py:attribute:: stream_id
207 .. py:attribute:: scheme
212 .. py:attribute:: method
217 .. py:attribute:: host
221 .. py:attribute:: path
225 .. py:attribute:: headers
229 A :py:class:`BaseRequestHandler` has the following methods:
231 .. py:method:: on_headers()
236 .. py:method:: on_data(data)
242 .. py:method:: on_request_done()
247 .. py:method:: on_close(error_code)
253 .. py:method:: send_response(status=200, headers=None, body=None)
259 instance of either ``str``, ``bytes``, :py:class:`io.IOBase` or
265 :py:data:`DATA_OK`, :py:data:`DATA_EOF` or
266 :py:data:`DATA_DEFERRED`. For non-empty byte string and it is
267 not the last chunk of response, :py:data:`DATA_OK` must be
269 (byte string could be ``None``), :py:data:`DATA_EOF` must be
272 :py:data:`DATA_DEFERRED`). When data arrived, call
273 :py:meth:`resume()` and restart response body transmission.
276 instance of :py:class:`io.IOBase` must not block.
288 … .. py:method:: push(path, method='GET', request_headers=None, status=200, headers=None, body=None)
301 semantics of *body* parameter of :py:meth:`send_response()`.
309 :py:class:`HTTP2Server` constructor for the pushed resource.
313 .. py:method:: resume()
317 :py:meth:`send_response()` about the body generator). It is not
321 .. py:data:: DATA_OK
325 .. py:data:: DATA_EOF
329 .. py:data:: DATA_DEFERRED
334 The following example illustrates :py:class:`HTTP2Server` and
335 :py:class:`BaseRequestHandler` usage: