I am building an inventory system in which a qr code is scanned, which calls the Trello API and adds a card to reorder the appropriate item. To do this, the qr code directs to a functional url that triggers an aws lambda function to send the request. I have built it in python and have it working well, with one catch – if the url is visited in Chrome it posts twice. Anyone have an idea what could cause this and how to avoid it? code is in python, below:
import json
import urllib3
def lambda_handler(event, context):
http = urllib3.PoolManager()
r = http.request('POST', 'https://api.trello.com/1/cards?key=<mykey>&token=<mytoken>&name=new card&idList=<listid>')
I have reducing the code to a bare minimum, expecting at some points results consistent with Firefox and Safari without success.
user25566469 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.