问题
I'm doing some experiments with the Clockify API. It uses curl but I figured a way with python requests.
In the Time-Entry Section there's a optional parameter you can pass. Basically without this parameter the duration format of the time-entry show's up in letters and numbers. It's the "consider-duration-format" parameter btw.
I tried passing this parameter through
url = 'https://api.clockify.me/api/v1/workspaces/{workspaceID}/user/{userID}/time-entry
headers = {'X-Api-Key': 'my_api_key',
'content-type': 'application/json'}
data = {'consider-duration-format': True}
req = requests.get(url, data=data, headers=headers)
print(req.json())
The duration format didn't change so then I tried params
params= {'consider-duration-format': True}
req = requests.get(url, params=params, headers=headers)
print(req.json())
And unfortunately it also didn't work.
来源:https://stackoverflow.com/questions/65725869/requesting-with-parameters