I'm writing a function in Flask that takes a list of IDs and sends a request to Amazon for data on those IDs. I'm running into an issue where the contents of the form are not splitting the way I want it to. I'd like it to be split by a comma or whitespace so that each ID is sent to the request, but instead it's sending a request for each individual character in the form.
As an example, I would put IDs in the form as 'id-12345, id-24689' and it would send a request for those ids. Rather, it is sending a request for 'i', 'd',' '-', etc... Here's the code for the form request:
if request.method == 'POST':
IDlist = []
ids = request.form['ids']
f_n = request.form['f_n']
for i in ids:
i.split(',')
IDlist.append(i)