statusAPI.py 文件源码

python
阅读 16 收藏 0 点赞 0 评论 0

项目:AirMapSDK-Embedded 作者: airmap 项目源码 文件源码
def get_status(self,gps_lat,gps_lon,weather):
        if Globals.AirConnected:
            try:
                self.connection = httplib.HTTPSConnection(Globals.httpsAddr, Globals.httpsPort, timeout=Globals.timeOut)
                self.headers = Globals.xapikey
                self.connection.request('GET', '/status/v2/point?latitude='+gps_lat+'&longitude='+gps_lon+'&weather='+weather, '', self.headers)
                    result = self.connection.getresponse().read()
                self.status_json = json.loads(result)
                Globals.strPrint (self.thisGlobals,self.status_json)
                return (self.status_json['status'] == "success")
            except Exception,e:
                Globals.strPrint (self.thisGlobals,"Airmap: No Connection or slow connection ->Request Timeout...")
                #Globals.strPrint(self.thisGlobals,str(e))

            return False

        else:
            Globals.strPrint (self.thisGlobals,"Not Connected")

        return False
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号