Skip to content

Error The operation couldn’t be completed. (NIO.NIOConnectionError error 1.) #149

@schmidarnold

Description

@schmidarnold

If I try to create a connection as shown in the doku I get the above error:

var request = try HTTPClient.Request(url: "https://swift.org", method: .GET)

//request.headers.add(name: "Authorization: \(authorizationHeader.description)" , value: "")
//print (request.headers.description)
httpClient.execute(request: request).whenComplete { result in
    switch result {
    case .failure(let error):
        print (error.localizedDescription)
    case .success(let response):
        if response.status == .ok {
            print (response.status)
        } else {
            print ("error in response")
        }
    }
}

Arnold

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions