# Path: awspider/unicodeconverter.py
# def convertToUTF8( s ):
#     s = UnicodeConverter( s ).unicode 
#     if isinstance( s, unicode ):
#         return s.encode("utf-8")
#     else:
#         return None


import urllib
import time
import dateutil.parser
import logging
from twisted.internet.defer import Deferred
from twisted.internet import reactor, ssl
from twisted.web.client import HTTPClientFactory, _parse
from .unicodeconverter import convertToUTF8
from OpenSSL import SSL

        **Arguments:**
         * *url* -- URL for the request.
         
        **Keyword arguments:**
         * *last_modified* -- Last modified date string to send as a request 
           header. (Default ``None``)
         * *etag* -- Etag string to send as a request header. (Default 
           ``None``)
         * *method* -- HTTP request method. (Default ``'GET'``)
         * *postdata* -- Dictionary of strings to post with the request. 
           (Default ``None``)
         * *headers* -- Dictionary of strings to send as request headers. 
           (Default ``None``)
         * *agent* -- User agent to send with request. (Default 
           ``'RequestQueuer'``)
         * *timeout* -- Request timeout, in seconds. (Default ``60``)
         * *cookies* -- Dictionary of strings to send as request cookies. 
           (Default ``None``).
         * *follow_redirect* -- Boolean switch to follow HTTP redirects. 
           (Default ``True``)
         * *prioritize* -- Move this request to the front of the request 
           queue. (Default ``False``)         

        """
        if headers is None:
            headers={}
        if postdata is not None:
            if isinstance(postdata, dict):
                for key in postdata:

# Path: awspider/unicodeconverter.py
# def convertToUTF8( s ):
#     s = UnicodeConverter( s ).unicode 
#     if isinstance( s, unicode ):
#         return s.encode("utf-8")
#     else:
#         return None


# Path: awspider/requestqueuer.py
import urllib
import time
import dateutil.parser
import logging
from twisted.internet.defer import Deferred
from twisted.internet import reactor, ssl
from twisted.web.client import HTTPClientFactory, _parse
from .unicodeconverter import convertToUTF8
from OpenSSL import SSL


        **Arguments:**
         * *url* -- URL for the request.
         
        **Keyword arguments:**
         * *last_modified* -- Last modified date string to send as a request 
           header. (Default ``None``)
         * *etag* -- Etag string to send as a request header. (Default 
           ``None``)
         * *method* -- HTTP request method. (Default ``'GET'``)
         * *postdata* -- Dictionary of strings to post with the request. 
           (Default ``None``)
         * *headers* -- Dictionary of strings to send as request headers. 
           (Default ``None``)
         * *agent* -- User agent to send with request. (Default 
           ``'RequestQueuer'``)
         * *timeout* -- Request timeout, in seconds. (Default ``60``)
         * *cookies* -- Dictionary of strings to send as request cookies. 
           (Default ``None``).
         * *follow_redirect* -- Boolean switch to follow HTTP redirects. 
           (Default ``True``)
         * *prioritize* -- Move this request to the front of the request 
           queue. (Default ``False``)         

        """
        if headers is None:
            headers={}
        if postdata is not None:
            if isinstance(postdata, dict):
                for key in postdata:

                    postdata[key] = convertToUTF8(postdata[key])