Show HTTP request duration in Swagger UI

前端 未结 2 378
你的背包
你的背包 2021-01-06 12:05

Swagger UI has the displayRequestDuration parameter to show how long a request takes. It\'s disabled by default.

How can this be enabled in the SwaggerConfig.cs conf

2条回答
  •  庸人自扰
    2021-01-06 12:26

    According to the documentation, this is a Swagger UI configuration. For my .Net Core app, I was able to get the Request duration with the following code.

    app.UseSwaggerUI(c =>
        {
            c.DisplayRequestDuration();
            .... (other configurations)
        });
    

    Example for the Request Duration

提交回复
热议问题