diff --git a/GetSchedulePackager.py b/GetSchedulePackager.py index dd6d129..47ce8c4 100644 --- a/GetSchedulePackager.py +++ b/GetSchedulePackager.py @@ -19,8 +19,6 @@ def getSchedulePackager(): """ return { - "statusCode": 200, - "isBase64ENcoded": "false", - "body": json.dumps(ymlschedule) + "interviewDates": json.dumps(ymlschedule) } diff --git a/__pycache__/GetSchedulePackager.cpython-313.pyc b/__pycache__/GetSchedulePackager.cpython-313.pyc index 989c23a..b58de92 100644 Binary files a/__pycache__/GetSchedulePackager.cpython-313.pyc and b/__pycache__/GetSchedulePackager.cpython-313.pyc differ diff --git a/__pycache__/postSelectAppointment.cpython-313.pyc b/__pycache__/postSelectAppointment.cpython-313.pyc index 1113012..66e96de 100644 Binary files a/__pycache__/postSelectAppointment.cpython-313.pyc and b/__pycache__/postSelectAppointment.cpython-313.pyc differ diff --git a/newMain.py b/newMain.py index ed64afa..0b6ed2e 100644 --- a/newMain.py +++ b/newMain.py @@ -30,7 +30,27 @@ from GetSchedulePackager import getSchedulePackager @app.get("/getSchedule") def getSchedule(): + res = getSchedulePackager() + + return JSONResponse( + headers={ + "isBase64Encoded": "false", # Header Modification + }, + content={ + "body": res + }, + + # status_code=200 commented out just to show how to change it if you wanted + ) + +from postSelectAppointment import SelectAppointment + +@app.post("/SelectInterview") +def postSelectInterview(request): + + res = SelectAppointment(request) + return JSONResponse( headers={ "isBase64Encoded": "false", # Header Modification diff --git a/postSelectAppointment.py b/postSelectAppointment.py index 5a5688a..b32553c 100644 --- a/postSelectAppointment.py +++ b/postSelectAppointment.py @@ -1,5 +1,6 @@ import json import datetime +import requests def SelectAppointment (appointmentJson): """ @@ -16,6 +17,8 @@ def SelectAppointment (appointmentJson): ``Contact``: darkicewolf50@gmail.com """ + print(appointmentJson) + status = mockWriteFunction(appointmentJson) if status: diff --git a/testhttp.py b/testhttp.py index b5067e5..ff7d9c0 100644 --- a/testhttp.py +++ b/testhttp.py @@ -13,6 +13,13 @@ def BenchMarkDjango(): # print(json.dumps(res, indent=1)) if __name__ == "__main__": - djangoTime = timeit.timeit(stmt=BenchMarkDjango, number=10) - pythonTime = timeit.timeit(stmt=BenchMarkServer, number=10) - print(f"FastAPI: {djangoTime}\nPython: {pythonTime}") \ No newline at end of file + test = 0 + if test: + djangoTime = timeit.timeit(stmt=BenchMarkDjango, number=10) + pythonTime = timeit.timeit(stmt=BenchMarkServer, number=10) + print(f"FastAPI: {djangoTime}\nPython: {pythonTime}") + + reqbody = { + "body": {"message": "hello"} + } + rawRes = requests.post("http://localhost:8000/SelectInterview", reqbody)