Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to get response time not shown in /docs or /redoc similar to POSTMAN? #564

Closed
scheung38 opened this issue Sep 24, 2019 · 8 comments
Closed
Labels
question Question or problem question-migrate

Comments

@scheung38
Copy link

Description

How can I show /docs or /redoc response time similar to that of POSTMAN?

Additional context
Add any other context or screenshots about the feature request here.

@scheung38 scheung38 added the question Question or problem label Sep 24, 2019
@scheung38 scheung38 changed the title [QUESTION] How to get . response time not shown in /docs or /redoc similar to POSTMAN? [QUESTION] How to get response time not shown in /docs or /redoc similar to POSTMAN? Sep 24, 2019
@euri10
Copy link
Contributor

euri10 commented Sep 24, 2019 via email

@dmontagu
Copy link
Collaborator

Also, /docs and /redoc are showing an externally-provided interface, not something that is directly a part of FastAPI. The swagger UI has a github repo where you can post questions like this.

@tiangolo
Copy link
Owner

You can also use a middleware to add an additional header. That's exactly the example in the docs: https://fastapi.tiangolo.com/tutorial/middleware/#create-a-middleware

@github-actions
Copy link
Contributor

Assuming the original issue was solved, it will be automatically closed now. But feel free to add more comments or create new issues.

@jhoelzl
Copy link

jhoelzl commented Jan 23, 2021

I still can not found any infos how to enable the information "Request duration" in Swagger UI, that appears after the request is done. In Flask ths can be enabled by app.config.SWAGGER_UI_REQUEST_DURATION = True. How to do this in FastAPI?

I am also hosting the Swagger UI javascript locally (as static file), however, i could not find any variable that fits.

@ycd
Copy link
Contributor

ycd commented Jan 23, 2021

@jhoelzl when #2568 is merged, you can set displayRequestDuration to true.

@zffocussss
Copy link

@ycd how to set it, can you show me sample codes?

@fromm1990
Copy link

@zffocussss you need to set it as follows:

app = FastAPI(swagger_ui_parameters={"displayRequestDuration": True})

@tiangolo tiangolo changed the title [QUESTION] How to get response time not shown in /docs or /redoc similar to POSTMAN? How to get response time not shown in /docs or /redoc similar to POSTMAN? Feb 24, 2023
@tiangolo tiangolo reopened this Feb 28, 2023
Repository owner locked and limited conversation to collaborators Feb 28, 2023
@tiangolo tiangolo converted this issue into discussion #8096 Feb 28, 2023

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
question Question or problem question-migrate
Projects
None yet
Development

No branches or pull requests

8 participants