Zillow Base

FREEMIUM
Durch tvh81 | Aktualisiert 2 months ago | Data
Popularität

9.3 / 10

Latenz

600ms

Service Level

100%

Health Check

N/A

Zurück zu allen Diskussionen

A server with the specified hostname could not be found.

Rapid account: Amourinetech
amourinetech
10 months ago

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 months ago

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.

Nehmen Sie an der Diskussion teil - fügen Sie unten einen Kommentar hinzu:

Anmelden / Registrieren, um neue Kommentare zu veröffentlichen