             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 var dataTaskResponseBufferKey = 0
private var taskAssociatedObjectCompletionHandlerKey = 0

/// `NSURLSessionAdapter` connects `NSURLSession` with `Session`.

/// delegate methods that you want to implement. Since `NSURLSessionAdapter` also implements delegate methods
/// `URLSession(_:task: didCompleteWithError:)` and `URLSession(_:dataTask:didReceiveData:)`, you have to call
/// `super` in these methods if you implement them.
public class NSURLSessionAdapter: NSObject, SessionAdapterType, NSURLSessionDelegate, NSURLSessionTaskDelegate {
    /// The undelying `NSURLSession` instance.
    public var URLSession: NSURLSession!
    
