Added the create project and item functions for the mark a course as completed app. Reorganized a bit and added classes for the project as well.
This commit is contained in:
@ -25,7 +25,7 @@ def get(url):
|
||||
|
||||
def post(url, payload):
|
||||
try:
|
||||
post_response = requests.get(url, headers=HEADERS, json=payload)
|
||||
post_response = requests.post(url, headers=HEADERS, json=payload)
|
||||
print(f"Executed Post Request. Status code is {get_response.status_code}")
|
||||
except HTTPError as h:
|
||||
print(
|
||||
@ -34,3 +34,15 @@ def post(url, payload):
|
||||
finally:
|
||||
json_post = get_response.json()
|
||||
# PP.pprint(json_post)
|
||||
|
||||
|
||||
def delete(url):
|
||||
try:
|
||||
get_response = requests.delete(url, headers=HEADERS)
|
||||
# print(f"Executed Get Request. Status code is {get_response.status_code}")
|
||||
except HTTPError as h:
|
||||
print(
|
||||
f"Error occurred. Here's the info: {h} and status code: {get_response.status_code}"
|
||||
)
|
||||
finally:
|
||||
return get_response
|
||||
|
||||
Reference in New Issue
Block a user