@@ -73,14 +73,25 @@ poking around in the code itself.
73
73
following attributes:
74
74
75
75
* ``code `` - HTTP response code (int)
76
- * ``content `` - content of next response (str)
76
+ * ``content `` - content of next response (str, bytes, or iterable of either )
77
77
* ``headers `` - response headers (dict)
78
+ * ``chunked `` - whether to chunk-encode the response (enumeration)
78
79
79
- Once these attribute are set, all subsequent requests will be answered with
80
+ Once these attributes are set, all subsequent requests will be answered with
80
81
these values until they are changed or the server is stopped. A more
81
82
convenient way to change these is ::
82
83
83
- httpserver.serve_content(content=None, code=200, headers=None)
84
+ httpserver.serve_content(content=None, code=200, headers=None, chunked=pytest_localserver.http.Chunked.NO)
85
+
86
+ The ``chunked `` atribute or parameter can be set to
87
+
88
+ * ``Chunked.YES ``, telling the server to always apply chunk encoding
89
+ * ``Chunked.NO ``, telling the server to never apply chunk encoding
90
+ * ``Chunked.AUTO ``, telling the server to apply chunk encoding only if
91
+ the ``Transfer-Encoding `` header includes ``chunked ``
92
+
93
+ If chunk encoding is applied, each str or bytes in ``content `` becomes one
94
+ chunk in the response.
84
95
85
96
The server address can be found in property
86
97
0 commit comments