当前位置:网站首页>"Introduction to interface testing" punch in to learn day05: how can a testing framework support restful interfaces?
"Introduction to interface testing" punch in to learn day05: how can a testing framework support restful interfaces?
2022-07-25 02:30:00 【Field test record】
Focus on : Bearing mode and operation mode of data exchange
RESTful Style interface is mainly based on JSON Format for data exchange
RESTful The provisions of the , send HTTP A lot of methods have been used , for instance ,Get Method is used to obtain resources ,Post Method is used to create a new resource ( Or update resources ); Again for instance ,Put Method to update the resource 、Delete Method is used to delete resources and so on .
What needs to be added to the framework , Ability to support RESTful Style interface ?
1、 With the help of external forces
RESTful The first way to carry data exchange is JSON, If you still have to piece together a lot of complex data , You need to use JSON String and code object entity conversion , It has a professional name : Serialization and deserialization
So that your framework can quickly complete serialization and deserialization , I suggest you introduce an externally supported library into your code , It's like Python Yes JSON library 、Java Yes Fastjson library . In fact, these public libraries do not need to be modified , You can use it , therefore , No matter which technology stack you use , Such basic libraries exist , You just need to look online , Then take a few minutes to see how to use , You can use it in your own framework .
2、 Self encapsulation
In order to achieve HTTP Agreed Put and Delete Method , It's self encapsulated put() Functions and delete() function . Actually , To achieve RESTful Style interface test , You just need to package HTTP The agreement corresponds to Method The method will do 了 , such , Your framework can perfectly support RESTful Style interface .
边栏推荐
- Visualization of correlation coefficient matrix
- 6. Object storage
- High performance memory recovery technology for decrypting ark -- HPP GC
- Cookies and sessions
- Scalar, vector, matrix calculus
- File file name change
- On the economic model of open source ecology
- Beijing Zhun electric clock, Beidou clock server, GPS network time server, NTP satellite timing system
- VRRP virtual redundancy protocol configuration
- What are the basic skills of engineers? How to practice? -- Learning experience sharing "suggestions collection"
猜你喜欢
![Simulation Implementation of [STL] string class](/img/be/2e4f8dd7da59753e109b38fdf51fba.png)
Simulation Implementation of [STL] string class

July 8, 2022

Generator set work arrangement problem code

High performance memory recovery technology for decrypting ark -- HPP GC

Custom types in C language

See you in Suzhou! "Cloud Intelligence Technology Forum - industry special" will be held soon

Jsonp solves cross domain plug-ins (JS, TS)

ICO objects in classification

Apk packaging process

Hbuilderx developed by uni app connects to night God simulator
随机推荐
After six years of precipitation, new consumption has found a digital transformation paradigm
Ten year structure and five-year Life-03 trouble as a technical team leader
[leetcode] 2. Add two numbers - go language problem solving
[circular array] JS method collection of circular array
Gbase 8s how to query relational databases in sentences to select sample syntax and results of data from complex types
About the relationship between parent process and child process (UAC bypass idea)
Jenkins configuration plug-in interface displays "suggestions collection" in Chinese
Case analysis of building exhibition service management system with low code development platform
Inventory of well-known source code mall systems at home and abroad
Data integration | what are the tools for data integration at home and abroad?
Seven text editors that programmers should know are necessary for programming
How to communicate with aliens
Details of C language compilation preprocessing and comparison of macros and functions
Chinese son-in-law OTA Ono became the first Asian president of the University of Michigan, with an annual salary of more than 6.5 million!
"Nowadays, more than 99.9% of the code is garbage!"
xts performance auto fix script
[leetcode] 3. Longest substring without repeated characters - go language problem solution
Project management tool Zen
Today in history: the kotlin language was published for the first time; The father of the IMAP agreement was born; CT imaging achieves a new breakthrough
Yunyuanyuan (VIII) | Devops in depth Devops