问题
I am using below code to get json response for Google maps api , Unable to get json response. Making get request using Alamofire pod.
Alamofire.request( "https://maps.googleapis.com/maps/api/distancematrix/json?origins=Vancouver+BC|Seattle&destinations=San+Francisco|Victoria+BC&key=<API_KEY>",method: .get,encoding: JSONEncoding.default)
.responseString {response in
print(response.request) // original URL request
print(response.response) // HTTP URL response
print(response.data) // server data
print(response.result)
}
Facing below error:
nil
nil
Optional(0 bytes)
FAILURE
来源:https://stackoverflow.com/questions/41995419/unable-to-fetch-response-for-google-distance-matrix-in-swift