After the project was developed and tested, the tester found a bug, and after a closer look, the original error report of an interface turned red.
This is the first tip of . For abnormal APIs, please use 400+ status codes to represent them. The 400+ status codes are red under browser developer tool debugging, and you can locate the abnormal API at a glance.
After the tester finds this abnormal request, how do they inform the back-end development?
When filing bugs on the bug management platform, attach the following information.
- Notify the currently logged in user
- Notify the current page
- Inform the page operation steps
However, this is too cumbersome, in fact, only one curl
can be done.
- Select the exception API in the console and right-click
Copy as cURL
. - Paste the curl command in the context of the bug
This is the second trick of , copy the cURL of the abnormal API in the browser console and throw it to the backend
After the backend gets the curl, there is no need to log in or operate the page to break the point to locate the problem. But how to better control the parameters passed by the Body? And modifying parameters in curl is very complicated.
At this time, you can directly convert curl into a request in in API debugging tools such as 1621deeaf85f14 Apifox , and it is very convenient to modify parameters at this time.
This is the third trick of , import cURL through API debugging tools such as Apifox , etc., to facilitate the modification of parameters
In addition, API requests can also be converted into code in Apifox, so this crawler is very convenient:
- Refresh the page and find the crawler target API interface
- Convert the API interface to cURL
- Requests to import cRUL into Apifox
- Generate code for requests in Apifox
**粗体** _斜体_ [链接](http://example.com) `代码` - 列表 > 引用
。你还可以使用@
来通知其他用户。