简体   繁体   中英

how to Test Restful API Efficiently with Multi Requests .

We have about 50 Restful JSON APIs Between An Android app and PHP backend. WE have Problems Related To The Restful APIs. The problems Can be Categorized into 3 types .

1- API Response sometimes Very Slow

2- API Response Sometimes not Stable and Response back With Error.

3- API Does not Work After Doing Multiply Requests.

WE have tried Postman For Testing and it seems that Everything Works without any problem. but once we try The API on The Runtime through The Android Application the 3 types of problems starts to appear. we are hosting on Azure Cloud Servers.

We are not Sure what Exactly causing the issue. we are doing "Header Allow Access Control" in Each API class and we still having an issue . any recommendations?

Thanks ,

Per your description:

WE have tried Postman For Testing and it seems that Everything Works without any problem.

I think you need to pay more attention on the client side, and the data type during transmission.

1, check whether the response is the standard Json object which can be parsed and serialized on client app

2, check whether the client has called the rest APIs in correct format and correct parameter settings

3, check the workflow of the mulit requests

If your backend service is hosted on Azure Web apps, you need to set always on as on. Because Azure will unload your site if it is idle for a period of timeout, which can cause slow response for the initial request.

Respectively, you can log the time of getting requests and sending response on server side, and log this metric on client side. Compare these logs to confirm the issue.

BTW, if the issue shows up when you have a heave traffic requests. You can try to scale up your instance.

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