Commit 2a88d7aa authored by Giuseppe Tropea's avatar Giuseppe Tropea
Browse files

addede DEL prior to POST

parent 11b02d0b
Loading
Loading
Loading
Loading
+19 −2
Original line number Diff line number Diff line
import requests
import json

site_request = requests.get("https://docs.google.com/a/google.com/spreadsheets/d/1AfsmGlSyb7rqMgfRSF-S4PpcUyTi7Fhx/gviz/tq?range=A1:N394&headers=1&tq=select%20G%2CI&tqx=out:json")
googlesheet_url = "https://docs.google.com/a/google.com/spreadsheets/d/1AfsmGlSyb7rqMgfRSF-S4PpcUyTi7Fhx/gviz/tq?range=A1:N394&headers=1&tq=select%20G%2CI&tqx=out:json"
site_request = requests.get(googlesheet_url)

site_response = str(site_request.content)

@@ -26,3 +27,19 @@ for row in table["rows"]:
        column_index += 1
    testcaseinfo.append(testcase)
print(testcaseinfo)

# The URL of the REST endpoint of the NoSQL database
dburl = "http://ec2-18-153-159-20.eu-central-1.compute.amazonaws.com:5555/googlesheet"
requests.delete(dburl)
# Set the appropriate headers for JSON, if required by the endpoint
headers = {
    'Content-Type': 'application/json',
    'Accept': 'application/json',
    # Include any other headers the API requires
}
# Make the POST request
response = requests.post(dburl, data=json.dumps(testcaseinfo), headers=headers)

# Check the response (status code, content, etc.)
print(response.status_code)
print(response.text)