Closed michalpokusa closed 1 year ago
If possible, please test the impact of these changes to request processing speed. In theory there should not be much overhead, but in my testing I noticed a very big range (80ms-500ms). Although this might be caused by my WiFi and the connection itself, it we be great it anyone could eliminate the possibility that it is the code's fault.
Thanks in advance. 🙂
PR does not contain any breaking changes, I suggest publishing it as 4.1.0.
⭐ Added:
FormData
class andRequest.form_data
for parsing POST body for"application/x-www-form-urlencoded"
,"multipart/form-data"
,"text/plain"
content types.Server.headers
for setting headers that are sent with every response, without need for explicitly adding them in constructor.Server.poll()
return value that indicates the result of polling e.g.NO_REQUEST
orREQUEST_HANDLED_RESPONSE_SENT
.🛠️ Updated:
ChunkedResponse
sending empty chunk was breaking functionality, because it ended response prematurely.Server.stopped
is set toTrue
in constructor, it changes toFalse
only after calling.start()
.server_forever()
.🏗️ Refactor:
query_params
andform_data
to use_IFieldStorage
for shared functionality.