 
 http = require 'http'
+https = require 'https'
 url = require 'url'
 
 qs = require 'querystring'


        if options.url
            #console.log url.parse options.url
            {auth, hostname, port, path} = url.parse options.url
            if auth
                options.auth = auth
            options.host = hostname
            options.port = port
            options.path = path


            #console.log options

            req = tools._findModule(options).request options, (res)->

                tools.readResponse res, fn

            req.on 'error', fn

            req.write data

    ##
    ##
    ##
    _findModule: (options)->
        #console.log 'find module for protocol', options.protocol
        if options.protocol is 'https:'
            return https
        return http

    ##
    ##
