简体   繁体   中英

How to handle large amount of json data response payload in fastapi?

a get call which has many lines of json respone gets some time to respond in swagger ui.

how can reduce this time; but, i want each response attrebute from my big responds model..

i have tried gzip content encoading. but, it does not solved my problem; because of the large number of line response;

for eg: while getting all job details (note:one job responds 36000 line response)

I'm a beginner

You don't have an issue with FastAPI. Your question is how to handle a large response body with Swagger UI.

a get call which has many lines of json respone gets some time to respond in swagger ui.

This is a known issue with Swagger UI, even sometimes large response bodies cause hanging( see ).

how can reduce this time

In your case using some tool like Postman or Insomnia could fix this.

i have tried gzip content encoading. but, it does not solved my problem; because of the large number of line response;

Expected. This will not make any effect in Swagger, yes it can reduce the latency when you are dealing with large response bodies. But in the end, Swagger is going to show it as JSON. So this will not make any changes to your Swagger experience.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM