Unable to fetch Response For Google Distance matrix in Swift

心已入冬 提交于 2019-12-24 07:27:11

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!