name ' undefined 'is notdefined

import http.client import json start = 80 for start in range(30000): #这里把端口拼接起来 conn = http.client.HTTPSConnection("127.0.0.1:"+str(start), undefined) payload = json.dumps([]) headers = { 'Content-Type': 'application/json' } conn.request("POST", "/v1/filscan/ActorById", payload, headers) res = conn.getresponse() # 这里要判断一下请求是否成功 if res.code == 200: data = res.read() print(data.decode("utf-8")) 这个Python代码那个undefined的错误要怎么解决

把 , undefined 删掉

conn = http.client.HTTPSConnection("127.0.0.1:"+str(start)) 

 

您好,我是有问必答小助手,您的问题已经有小伙伴解答了,您看下是否解决,可以追评进行沟通哦~

如果有您比较满意的答案 / 帮您提供解决思路的答案,可以点击【采纳】按钮,给回答的小伙伴一些鼓励哦~~

ps:问答VIP仅需29元,即可享受5次/月 有问必答服务,了解详情>>>https://vip.csdn.net/askvip?utm_source=1146287632

问题:没有定义的错误;

解决:找到对应代码 查看是否传了空值。