b.t.h.response : module documentation

Part of bzrlib.transport.http

Handlers for HTTP Responses.

The purpose of these classes is to provide a uniform interface for clients to standard HTTP responses, single range responses and multipart range responses.

Class RangeFile File-like object that allow access to partial available data.
Function handle_response Interpret the code & headers and wrap the provided data in a RangeFile.
def handle_response(url, code, msg, data):
Interpret the code & headers and wrap the provided data in a RangeFile.

This is a factory method which returns an appropriate RangeFile based on the code & headers it's given.

ParametersurlThe url being processed. Mostly for error reporting
codeThe integer HTTP response code
msgAn HTTPMessage containing the headers for the response
dataA file-like object that can be read() to get the requested data
ReturnsA file-like object that can seek()+read() the ranges indicated by the headers.
API Documentation for Bazaar, generated by pydoctor at 2022-06-16 00:25:16.