src.core.http.providers.response
index
/home/stanislav/PycharmProjects/opendoor/src/core/http/providers/response.py

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License.
 
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.
 
You should have received a copy of the GNU General Public License
along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
Development Team: Stanislav WEB

 
Modules
       
re

 
Classes
       
__builtin__.object
ResponseProvider

 
class ResponseProvider(__builtin__.object)
    ResponseProvider class
 
  Methods defined here:
__init__(self, config)
Response instance
:param src.lib.browser.config.Config config: configurations
detect(self, request_url, response)
Detect response by status code
:param str request_url: request url
:param urllib3.response.HTTPResponse response: response object
:raise Exception
:return: str
handle(self, response, request_url, items_size, total_size)
Response handler
:param urllib3.response.HTTPResponse response: response object
:param str request_url: url from request
:param int items_size: current items sizes
:param int total_size: response object
:raise ResponseError
:return: dict

Data descriptors defined here:
__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)
is_indexof
Check response as index of/ page
:return: bool

Data and other attributes defined here:
DEFAULT_HTTP_BAD_REQUEST_STATUSES = [400]
DEFAULT_HTTP_FAILED_STATUSES = [404, 406, 429, 500, 501, 502, 503, 504]
DEFAULT_HTTP_FORBIDDEN_STATUSES = [401, 403]
DEFAULT_HTTP_REDIRECT_STATUSES = [301, 302, 303, 304, 307, 308]
DEFAULT_HTTP_SUCCESS_STATUSES = [100, 101, 200, 201, 202, 203, 204, 205, 206, 207, 208]
DEFAULT_SOURCE_DETECT_MIN_SIZE = 1000000
HTTP_DBG_LEVEL = 3
INDEX_OF_TITLE = 'Index of /'