我遵循了Limit woocommerce orders by IP
中的步骤但是我只有XML文件。如何通过API获取json数据?
我正在使用Flask,下面是我的代码
@app.route('/consumer', methods=['POST','GET'])
def consumer():
r = requests.get('https://www.saferproducts.gov/webapi/Cpsc.Cpsrms.Web.Api.svc', auth=('mykey', ''))
return render_template('test.html',r=r.text)