Code: Select all
import urequests
# The URL is the copied link that is shared with others. Formatting is string
url = 'https://docs.google.com/forms/d/e/<form_id>/formResponse'
# The following header MUST be included:
headers = {'Content-Type': 'application/x-www-form-urlencoded'}
# Form data seems to follow a urlencoded format. It is a string with entries=values separated by '&'
form_data = 'entry.entry_id_1=value_1&entry.entry_id_2=value_2'
# send the url, form_data and headers using urequest.post()
r = urequests.post(url, data=form_data, headers=headers)
#Close the connection to prevent memory errors
r.close()