HTTP utilities and transports - mushroom.http¶
Request and response¶
-
class
mushroom.http.
HttpRequest
(environ)¶
-
class
mushroom.http.
HttpResponse
(code='200 OK', content='', extra_headers=None)¶
-
class
mushroom.http.
JsonResponse
(data)¶
Transports¶
-
class
mushroom.http.
HttpTransport
¶ -
get_url
(protocol, request, session)¶
-
handle_http_request
(request, session)¶
-
-
class
mushroom.http.
PollTransport
¶ -
get_handshake_data
(request, session)¶
-
handle_disconnect
(reconnect=False)¶
-
handle_http_request
(request, session)¶
-
name
= 'poll'¶
-
real_send
(message)¶ Perform the actual send operation. This method is only called internally and should not be called from application code. This method is transport specific and must be overwritten.
-
timeout
= 40¶
-
-
class
mushroom.http.
WebSocketTransport
¶ -
get_handshake_data
(request, session)¶
-
handle_disconnect
()¶
-
handle_http_request
(request, session)¶
-
handle_message
(message)¶
-
name
= 'ws'¶
-
real_send
(message)¶ Perform the actual send operation. This method is only called internally and should not be called from application code. This method is transport specific and must be overwritten.
-