HandleAuthentication¶
- class pystclient.clients.HandleAuthentication(request, client_address, server)¶
Bases:
BaseHTTPRequestHandlerHandle authentication.
- __init__(request, client_address, server)¶
Methods
__init__(request, client_address, server)address_string()Return the client address.
date_time_string([timestamp])Return the current date and time formatted for a message header.
do_POST()Handle POST request for authentication.
end_headers()Send the blank line ending the MIME headers.
finish()flush_headers()handle()Handle multiple requests if necessary.
handle_expect_100()Decide what to do with an "Expect: 100-continue" header.
handle_one_request()Handle a single HTTP request.
log_date_time_string()Return the current time formatted for logging.
log_error(format, *args)Log an error.
log_message(format, *args)Log an arbitrary message.
log_request([code, size])Log an accepted request.
parse_request()Parse a request (internal).
send_error(code[, message, explain])Send and log an error reply.
send_header(keyword, value)Send a MIME header to the headers buffer.
send_response(code[, message])Add the response header to the headers buffer and log the response code.
send_response_only(code[, message])Send the response header only.
setup()version_string()Return the server software version string.
Attributes
default_request_versiondisable_nagle_algorithmerror_content_typeerror_message_formatmonthnameprotocol_versionrbufsizeresponsesserver_versionsys_versiontimeoutwbufsizeweekdayname- do_POST() None¶
Handle POST request for authentication.
- log_message(format: str, *args: Any) None¶
Log an arbitrary message.
This is used by all other logging functions. Override it if you have specific logging wishes.
The first argument, FORMAT, is a format string for the message to be logged. If the format string contains any % escapes requiring parameters, they should be specified as subsequent arguments (it’s just like printf!).
The client ip and current date/time are prefixed to every message.
Unicode control characters are replaced with escaped hex before writing the output to stderr.