skip to Main Content

why doesnt fastapi return my mongodb objects?

So I am trying to make a request on the route: http://127.0.0.1:8000/testadmins with the folowing function: @app.get("/testadmins/") async def get_admins(): return await get_database() get_database() is this: async def get_database(): uri = "(my mongo uri)" client = MongoClient(uri, server_api=ServerApi('1')) adms =…

VIEW QUESTION

Why does Postman show a sign-in page instead of ‘hello’ when calling a .NET API on Azure?

instead of returning hello it requires a sign in. I have tried to pass tokens etc. this works fine in the browser[cannot seem to replicate openID connect auth flow] services.AddMicrosoftIdentityWebAppAuthentication(Configuration) .EnableTokenAcquisitionToCallDownstreamApi() .AddMicrosoftGraph(options => { Configuration.Bind("AzureAd", options); options.Scopes = AppSettings.GetScopes(); })…

VIEW QUESTION
Back To Top
Search