Thank you for the help, I will study this. I was able to work out my date problem satisfactorily. I do NOT use requests but rather urlopen to initiate conversation with my target API as follows:
back. Only the first date's data gets repeated even though I get a valid 200 response code each time I execute the
URLOPEN request. My iteration is straight forward...I ask user for a date range, populate a list containing all dates
in that range and then update my urldate parameter by looping through that list.
All seems fine, except I am not really getting the data for a different date. I loop through the correct amount of times, but no data refresh occurs.
Is there a proper way to iterate through sending repeated URL requests to a server? Do I need to clear cache somehow?
Any suggestions appreciated.
Thank you.
myurl = urllib.request.urlopen(urlstringbuild) urlstringbuild is a concatenated string of: part1 = domain info and user/pass etc. part2 = MY DATE VARIABLE WHICH NOW WORKS! part3 = string of additional parameters # so URLSTRINGBUILD=part1+part2+part3 # I then read the response data: resp_data=myurl.read() # Create a JSON dictionary from the results json_resp=json.loads(resp_data) # API response from URL is JSON formatALL OF THIS IS GOOD, BUT ----- when I try to ITERATE THROUGH MULTIPLE DATES, I keep getting the SAME data
back. Only the first date's data gets repeated even though I get a valid 200 response code each time I execute the
URLOPEN request. My iteration is straight forward...I ask user for a date range, populate a list containing all dates
in that range and then update my urldate parameter by looping through that list.
All seems fine, except I am not really getting the data for a different date. I loop through the correct amount of times, but no data refresh occurs.
Is there a proper way to iterate through sending repeated URL requests to a server? Do I need to clear cache somehow?
Any suggestions appreciated.
Thank you.