protocol.abstract.request Module

Request object abstractions

class wpull.protocol.abstract.request.BaseRequest[source]

Bases: wpull.protocol.abstract.request.URLPropertyMixin

set_continue(offset: int)[source]
class wpull.protocol.abstract.request.BaseResponse[source]

Bases: wpull.protocol.abstract.request.ProtocolResponseMixin

class wpull.protocol.abstract.request.DictableMixin[source]

Bases: object

classmethod call_to_dict_or_none(instance)[source]

Call to_dict or return None.

to_dict()[source]

Convert to a dict suitable for JSON.

class wpull.protocol.abstract.request.ProtocolResponseMixin[source]

Bases: object

Protocol abstraction for response objects.

protocol

Name of the protocol.

Returns:Either ftp or http.
Return type:str
response_code()[source]

Response code representative for the protocol.

Returns:The status code for HTTP or the final reply code for FTP.
Return type:int
response_message()[source]

Response message representative for the protocol.

Returns:The status line reason for HTTP or a reply message for FTP.
Return type:str
class wpull.protocol.abstract.request.SerializableMixin[source]

Bases: object

Serialize and unserialize methods.

parse(data)[source]

Parse from HTTP bytes.

to_bytes()[source]

Serialize to HTTP bytes.

class wpull.protocol.abstract.request.URLPropertyMixin[source]

Bases: object

Provide URL as a property.

url

str

The complete URL string.

url_info

url.URLInfo

The URLInfo of the url attribute.

Setting url or url_info will update the other
respectively.
url
url_info