Package core :: Package data :: Package url :: Module xUrllib :: Class xUrllib
[hide private]
[frames] | no frames]

Class xUrllib



This is a urllib2 wrapper.


Author: Andres Riancho ( andres.riancho@gmail.com )

Instance Methods [hide private]
  __init__(self)
  _checkLocalCache(self)
Clearing cache used by localCache
  _dnsCache(self)
DNS cache trick This will speed up all the test ! Before this dns cache voodoo magic every request to the http server needed a dns query, this is slow on some networks so I added this feature.
  _init(self)
  getHeaders(self, uri)
Returns a dict with the headers that would be used when sending a request to the remote server.
  GET(self, uri, data='', headers={}, useCache=False, grepResult=True, getSize=False)
Gets a uri using a proxy, user agents, and other settings that where set previously.
  POST(self, uri, data='', headers={}, grepResult=True, getSize=False)
POST's data to a uri using a proxy, user agents, and other settings that where set previously.
  getRemoteFileSize(self, uri, headers={}, useCache=True)
  __getattr__(self, methodName)
This is a "catch-all" way to be able to handle every HTTP method.
  _addHeaders(self, req, headers={})
  _checkURI(self, req)
  _checkFileSize(self, req)
  _send(self, req, useCache=False, useMultipart=False, grepResult=True)
  _readRespose(self, res)
  _retry(self, req, useCache)
Try to send the request again.
  setGrepPlugins(self, grepPlugins)
  setEvasionPlugins(self, evasionPlugins)
  _evasion(self, uri)
  _grepResult(self, request, response)
  _createFuzzFromRequest(self, command, url, postData, headers)
Creates a fuzzable request based on a request.
  _grepWorker(self, request, response)

Method Details [hide private]

__init__(self)
(Constructor)

 
None

_checkLocalCache(self)

 
Clearing cache used by localCache

_dnsCache(self)

 

DNS cache trick This will speed up all the test ! Before this dns cache voodoo magic every request to the http server needed a dns query, this is slow on some networks so I added this feature.

This method was taken from: # $Id: download.py,v 1.30 2004/05/13 09:55:30 torh Exp $ That is part of : swup-0.0.20040519/

Developed by: # Copyright 2001 - 2003 Trustix AS - <http://www.trustix.com> # Copyright 2003 - 2004 Tor Hveem - <tor@bash.no> # Copyright 2004 Omar Kilani for tinysofa - <http://www.tinysofa.org>

_init(self)

 
None

getHeaders(self, uri)

 
Returns a dict with the headers that would be used when sending a request to the remote server.

GET(self, uri, data='', headers={}, useCache=False, grepResult=True, getSize=False)

 
Gets a uri using a proxy, user agents, and other settings that where set previously.
Parameters:
  • uri - This is the url to GET
  • data - A Query String object with the data for the GET, the query string.
Returns:
An httpResponse object.

POST(self, uri, data='', headers={}, grepResult=True, getSize=False)

 
POST's data to a uri using a proxy, user agents, and other settings that where set previously.
Parameters:
  • uri - This is the url where to post.
  • data - A string with the data for the POST.
Returns:
An httpResponse object.

getRemoteFileSize(self, uri, headers={}, useCache=True)

 
Returns:
The file size of the remote file.

__getattr__(self, methodName)
(Qualification operator)

 
This is a "catch-all" way to be able to handle every HTTP method.

_addHeaders(self, req, headers={})

 
None

_checkURI(self, req)

 
None

_checkFileSize(self, req)

 
None

_send(self, req, useCache=False, useMultipart=False, grepResult=True)

 
None

_readRespose(self, res)

 
None

_retry(self, req, useCache)

 
Try to send the request again.

setGrepPlugins(self, grepPlugins)

 
None

setEvasionPlugins(self, evasionPlugins)

 
None

_evasion(self, uri)

 
None

_grepResult(self, request, response)

 
None

_createFuzzFromRequest(self, command, url, postData, headers)

 
Creates a fuzzable request based on a request. This is for sending to the grep plugins.

_grepWorker(self, request, response)

 
None