我需要在Python中获取url的参数:
from wsgiref.simple_server import make_server, demo_app
def showresult(environ, start_response):
status = '200 OK' # HTTP Status
headers = [('Content-type', 'application/json')] # HTTP Headers
start_response(status, headers)
# The returned object is going to be printed
return "ok"
httpd = make_server('', 8081, showresult)
# Respond to requests until process is killed
httpd.serve_forever()
当我访问http://localhost:8081时,它执行的代码正常
我需要,当我访问“http://localhost:8081/?cid=5&aid=4”时 获取cid和aid值
实现这一点的一个简单方法是使用^{}
相关问题 更多 >
编程相关推荐