kean / Get

Web API client built using async/await
MIT License
943 stars 75 forks source link

localhost:yourPort/yourname/v1/yourEndpoint - A server with the specified hostname could not be found. #25

Closed adku closed 2 years ago

adku commented 2 years ago

Working url from Postman: http://localhost:9009/yourname/v1/endpointName

Paths are generated automatically from OpenApi via CreateAPI and looks like that: /v1/endpointName

Client host: APIClient(host: "localhost:9009/yourname") or: APIClient(host: "localhost/yourname")

let client: APIClient = APIClient(host: "localhost:9009/yourname") {
    //$0.port = 9009
    $0.isInsecure = true
    $0.delegate = YourDelegate()
}

Generated via Get package method makeURL(path: String, query: [(String, String?)]?) throws -> URL: http://localhost%3A9009%2Fyourname/v1/endpointName

Output error: NSLocalizedDescription=A server with the specified hostname could not be found., NSErrorFailingURLStringKey=http://localhost%3a9009%2fyourname/v1/endpointName?, NSErrorFailingURLKey=http://localhost%3a9009%2fyourname/v1/endpointName?, _kCFStreamErrorDomainKey=12}