Zillow Base

免费增值
通过 tvh81 | 已更新 2 месяца назад | Data
人气

9.3 / 10

延迟

600ms

服务等级

100%

Health Check

N/A

返回所有讨论

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.

加入讨论 - 在下面添加评论:

登录/注册以发布新的评论