我正在使用Here map multi-reversergeocode api。
我已经生成了自己的app_id和app_code,并尝试从我的Java代码中访问api。但是我遇到 inflater: LayoutInflater, container: ViewGroup?,
savedInstanceState: Bundle?
): View? {
spinner2?.adapter = ArrayAdapter(activity, R.layout.support_simple_spinner_dropdown_item, types) as SpinnerAdapter
spinner2?.onItemSelectedListener = object :AdapterView.OnItemSelectedListener{
override fun onNothingSelected(parent: AdapterView<*>?) {
println("erreur")
}
override fun onItemSelected(parent: AdapterView<*>?, view: View?, position: Int, id: Long) {
val type = parent?.getItemAtPosition(position).toString()
println(type)
}
}
return inflater.inflate(R.layout.fragment_add, container, false)
}
错误。
503 Service unavailable
答案 0 :(得分:0)
我尝试按照示例https://developer.here.com/api-explorer/rest/geocoder/multi-reverse-geocode中提供的说明进行操作,并能够成功获得响应。同样适用于https://reverse.geocoder.api.here.com/6.2/multi-reversegeocode.xml帖子网址。请检查您的身体和标题是否正确设置。如果您仍然遇到问题,请分享您的意见/建议。
curl \
-X POST \
-H 'Content-Type: *' \
-H 'Cache-Control: no-cache' \
-d 'id=0001&prox=52.5309,13.3845,50
id=0002&prox=50.1618,8.5334,50
id=0003&prox=40.7296,-73.9868,50
id=0004&prox=47.6098,-122.3425,50
id=0005&prox=-22.9804,-43.1897,50
id=0006&prox=-8.4943,115.2533,50
id=0007&prox=28.6338,77.2191,50
id=0008&prox=-33.9204,18.4208,50
id=0009&prox=21.0027,-89.6224,50
id=0010&prox=24.6607,46.712,50' \
'https://reverse.geocoder.api.here.com/6.2/multi-reversegeocode.json?mode=retrieveAddresses&gen=9&app_id=devportal-demo-20180625&app_code=9v2BkviRwi9Ot26kp2IysQ'