Zillow Base

FREEMIUM
Por tvh81 | Atualizado 2달 전 | Data
Popularidade

9.3 / 10

Latência

600ms

Nível de serviço

100%

Health Check

N/A

Voltar para todas as discussões

A server with the specified hostname could not be found.

Rapid account: Amourinetech
amourinetech
10달 전

I tried running your code sample in Swift.
I keep getting the following error via Xcode:

“A server with the specified hostname could not be found.”

Here’s my code:

func fetchData() async throws -> [Location] {
let url = URL(string: “https://zillow-base1.p.rapidapi.com/WebAPIs/zillow/locationSuggestions/v2?location=Brownsville%2C TX”)!
let headers = [
“X-RapidAPI-Key”: “1f7f2f561emsh5142da984f24635p19dcccjsn034500ecc809”,
“X-RapidAPI-Host”: “zillow-base1.p.rapidapi.com
]
var request = URLRequest(url: url, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers

let (data, _) = try await URLSession.shared.data(for: request)
let decoder = JSONDecoder()
let locations = try decoder.decode([Location].self, from: data)
return locations

}

Rapid account: Tvhaudev
tvhaudev Commented 10달 전

Hi amourinetech,

I’m sorry for the delayed response.

https://zillow-base1.p.rapidapi.com/WebAPIs/zillow/locationSuggestions/v2?location=Brownsville%2C TX
zillow-base1.p.rapidapi.com
I have confirmed that the hostname information is still functioning properly. Could you please fix the path and check it again for me?

Regarding the code you provided, I don’t have a MAC machine here, so I haven’t been able to test that piece of code yet.
I hope you understand.

Junte-se à discussão - adicione o comentário abaixo:

Efetue login / inscreva-se para postar novos comentários