Hi, I am trying to implement something similar to this but in Godot.
It just sends player responses to a google form.
I've managed to connect with the web site and make the request. But for some reason it is not submiting the respose.
This is what I've got so far:
var err = 0
var http = HTTPClient.new() # Create the Client.
err = http.connect_to_host("docs.google.com", 80) # Connect to host/port.
assert(err == OK) # Make sure connection was OK.
# Wait until resolved and connected.
while http.get_status() == HTTPClient.STATUS_CONNECTING or http.get_status() == HTTPClient.STATUS_RESOLVING:
assert(http.get_status() == HTTPClient.STATUS_CONNECTED) # Could not connect
var header = ["entry.986078935", "Content-Type: application/json"]
var field = JSON.print(str(user_melody))
var result = http.request(http.METHOD_POST, "/forms/d/e/1FAIpQLSe8Z91NGAN-ssDJbMSOuZtM7eWZQvt8mWoMxuJ79HtM-f4Qkg/formResponse", header, field)
# Keep polling until the request is going on
while (http.get_status() == HTTPClient.STATUS_REQUESTING):
# Make sure request finished
assert(http.get_status() == HTTPClient.STATUS_BODY or http.get_status() == HTTPClient.STATUS_CONNECTED)
The debug Output prints:
Not sure what is going on... If you have any clue, please let me know!