             }
             
             httpStatusCode = response!.httpStatusCode
-        } while httpStatusCode == .continue
+        } while httpStatusCode == .continue || httpStatusCode == .switchingProtocols
         
         self.callback(self.response)
     }

        return count
        
    }

    /// libCurl callback invoked when a redirect is about to be done
    fileprivate func prepareForRedirect() {

        /// - Note: This is very useful when working with self signed certificates.
        case disableSSLVerification
        
        /// If present, the client will try to use HTTP/2 protocol for the connection.
        case useHTTP2
        
    }
    
    /// Response callback closure type
