             URLRequest.setValue(value, forHTTPHeaderField: key)
         }
 
-        let task = URLSession.dataTaskWithRequest(URLRequest, completionHandler: handler)
+        let task: NSURLSessionTask
+        switch try request.bodyParameters?.buildEntity() {
+        case .Data(let data)?:
+            task = URLSession.uploadTaskWithRequest(URLRequest, fromData: data)
+
+        case .InputStream(let inputStream)?:
+            task = URLSession.uploadTaskWithStreamedRequest(URLRequest)
+            setInputStream(inputStream, forTask: task)
+
+        default:
+            task = URLSession.dataTaskWithRequest(URLRequest)
+        }
 
         setBuffer(NSMutableData(), forTask: task)
         setHandler(handler, forTask: task)

        }
    }

    private func setBuffer(buffer: NSMutableData, forTask task: NSURLSessionTask) {
        objc_setAssociatedObject(task, &dataTaskResponseBufferKey, NSMutableData(), .OBJC_ASSOCIATION_RETAIN_NONATOMIC)
    }

    private func bufferForTask(task: NSURLSessionTask) -> NSMutableData? {
        return objc_getAssociatedObject(task, &dataTaskResponseBufferKey) as? NSMutableData
    }

    private func setHandler(handler: (NSData?, NSURLResponse?, NSError?) -> Void, forTask task: NSURLSessionTask) {

        handlerForTask(task)?(bufferForTask(task), task.response, connectionError)
    }

    public func URLSession(session: NSURLSession, task: NSURLSessionTask, needNewBodyStream completionHandler: (NSInputStream?) -> Void) {
        completionHandler(inputStreamForTask(task))
    }

    // MARK: NSURLSessionDataDelegate
    public func URLSession(session: NSURLSession, dataTask: NSURLSessionDataTask, didReceiveData data: NSData) {
        bufferForTask(dataTask)?.appendData(data)
