             ("test_dataTaskWithURLRequest", test_dataTaskWithURLRequest),
             ("test_dataTaskWithURLCompletionHandler", test_dataTaskWithURLCompletionHandler),
             ("test_dataTaskWithURLRequestCompletionHandler", test_dataTaskWithURLRequestCompletionHandler),
+            ("test_dataTaskWithHttpInputStream", test_dataTaskWithHttpInputStream),
             ("test_downloadTaskWithURL", test_downloadTaskWithURL),
             ("test_downloadTaskWithURLRequest", test_downloadTaskWithURLRequest),
             ("test_downloadTaskWithRequestAndHandler", test_downloadTaskWithRequestAndHandler),

    }
}

extension HTTPRedirectionDataTask : URLSessionDataDelegate {
    public func urlSession(_ session: URLSession, dataTask: URLSessionDataTask, didReceive response: URLResponse, completionHandler: @escaping (URLSession.ResponseDisposition) -> Void) {
        guard let httpresponse = response as? HTTPURLResponse else { fatalError() }

        waitForExpectations(timeout: 12)
    }
    
    func test_dataTaskWithHttpInputStream() {
        func randomString(length: Int) -> String {
            let letters : NSString = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"
            let len = UInt32(letters.length)
            
            var randomString = ""
            
            for _ in 0 ..< length {
                let rand = arc4random_uniform(len)
                var nextChar = letters.character(at: Int(rand))
                randomString += NSString(characters: &nextChar, length: 1) as String
            }
            return randomString
        }
        
        let delegate = HTTPBinResponseDelegateJSON<HTTPBinResponse>()

        let dataString = randomString(length: 65537)
        
        let urlString = "http://httpbin.org/post"
        let url = URL(string: urlString)!
        let urlSession = URLSession(configuration: URLSessionConfiguration.default, delegate: delegate, delegateQueue: nil)

        var urlRequest = URLRequest(url: url)
        urlRequest.httpMethod = "POST"
        
        guard let data = dataString.data(using: .utf8) else {
            XCTFail()
            return
        }

        let inputStream = InputStream(data: data)
        inputStream.open()

        urlRequest.httpBodyStream = inputStream
        
        urlRequest.setValue("en-us", forHTTPHeaderField: "Accept-Language")
        urlRequest.setValue("text/xml; charset=utf-8", forHTTPHeaderField: "Content-Type")
        urlRequest.setValue("chunked", forHTTPHeaderField: "Transfer-Encoding")

        let urlTask = urlSession.dataTask(with: urlRequest)
        urlTask.resume()

        delegate.semaphore.wait()

        XCTAssertTrue(urlTask.response != nil)
        XCTAssertTrue(delegate.response != nil)
        XCTAssertTrue(delegate.response?.data == dataString)
    }
    
    func test_downloadTaskWithURL() {
        let urlString = "http://127.0.0.1:\(TestURLSession.serverPort)/country.txt"
        let url = URL(string: urlString)!
