大佬教程收集整理的这篇文章主要介绍了Web 服务如何显示数组类型对象的内容,大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
在下面发布的代码中,featuresArray
是一个功能数组。我希望下面发布的网络服务返回代码中所述的“featuresArray”。运行我收到的应用程序时
internal server error
但是,当我返回例如
feature[0] or specify the index
网络服务显示值。
那么我怎样才能让网络服务返回并显示对象 freaturesArray
python 代码:
@app.route("/geodata/<String:polygonCoordinates>",methods=['GET'] )
def geodata(polygonCoordinates):
...
...
url = url.replace(" ","%20")
BACkendResponseAsJsON = readResponseAsJsONForURL(url)
geoJsonObjectAsJsON = loadDataAsJsON(BACkendResponseAsJsON['geoJson'][0])
featuresArray = geoJsonObjectAsJsON['features']
for feature in featuresArray:
pass#print (featurE)
#baseURL = config['EndPoint']['https'] + config['EndPoint']['url'] + config['EndPoint']['API_key'] + config['EndPoint']['start'] + polygonCoordinates + "," + polygonCoordinates + config['EndPoint']['end'] + polygonCoordinates + "," + polygonCoordinates
#print("baseURL: %s"%(baseURL))
return featuresArray
数组或列表必须包含在里面 字符串() 只需执行以下操作:
User
以上是大佬教程为你收集整理的Web 服务如何显示数组类型对象的内容全部内容,希望文章能够帮你解决Web 服务如何显示数组类型对象的内容所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。