Pokealimit / Master-Python-100-Projects-100-Days

0 stars 0 forks source link

Day_38 Workout Tracker HTTPERROR: 400 #1

Closed Pokealimit closed 2 years ago

Pokealimit commented 2 years ago

Been trying to solve the following error when posting to google sheet through sheety:

    raise HTTPError(http_error_msg, response=self)
    requests.exceptions.HTTPError: 400 Client Error: Bad Request for url: https://api.sheety.co/xxxxxxxx/myWorkouts/workouts

Done the following below but yet to work:

Pokealimit commented 2 years ago

turns out parameter have to be singular while the endpoint is plural

https://api.sheety.co/xxxxxxxx/myWorkouts/workouts

      "workout": {
                  "date": only_date,
                  "time": only_time,
                  "exercise": exercise['exercise'],
                  "duration": exercise['duration'],
                  "calories": exercise['calories']
              }