当前位置:网站首页>Some thoughts learned recently are attached with answers, and further study and development of knowledge are required in the future.
Some thoughts learned recently are attached with answers, and further study and development of knowledge are required in the future.
2022-06-21 16:04:00 【QingHan】
One 、 What is the difference between data requested with parameters and data requested without parameters ?
The data you requested , It depends on the interface .
such as :http://127.0.0.1/user/info
user/info This interface determines that it will return user information .
The interface specifies the path and parameters , The requesting party is required to comply with this provision .
The interface specifies that it must carry id Parameters or other parameters , To return data correctly . You add parameters id=123.
The Convention takes parameters , And what format has parameters , Then the server returns the corresponding data according to the interface parameters .
Two 、 Thinking questions
The database is in the hard disk of the server , The data is in the database file . Such as sql Of mdf file . Some sensitive data , You need to test whether the data returned by the interface is consistent with the data in the database .
Here is me and Java Development Manager dialogue :
ask : The data returned by the interface may not be stored in the database , Database is used to store data , It's back to you , But it doesn't help you save the data . The next time you make a request, you will find that the returned data is incorrect . What scene is this ?
Is it my first time to register , Send a request to name and pwd To the server , The server returns the data to the client , The client side has successfully registered . But because the database does not store data , When I log in, I report an error . The request has no response data . That's what I mean ?
answer : There are two types of interface data . Data submitted : It is usually sent to the server for business logic .
Returned data : This is not sure whether it is the data from the database , May be processed .
ask : The interface request parameters must be consistent with the database fields , Otherwise, how do you know whether the returned data is consistent ?
answer : Not necessarily , Generally, to avoid exposing the database structure , It's not the same .
ask : How can the server find the data required by this parameter from the database , How does it judge ?
answer : Transform through interface conventions . Interface agreement :user= user name . The back end got it user , You can turn it into username.
According to the contract , The interface knows the meaning of every data you pass . If you spread more , Non compliant data , Interfaces are also not handled .
ask : The back-end code gets user , You can turn it into username , And then find it in the database username, Return the data of this field to the client through the interface . Is that so? ?
answer : Yes .
When you return, you can put username Change to another name , such as name,adminname.
ask : When requesting, the parameter name is name, In the middle , You should turn back when you return , So still name? Or just turn around ?
answer : Look at the request , It is generally required that the parameter names of the request and response are consistent . Some are more sensitive , Worry about exposing the database field structure , It will be separately modified to :
The request parameter is consistent with the returned parameter name , The database field has another name . Look at the database field name , It is completely invisible that it is related to the request parameter name .
3、 ... and 、 Common sense complements
1. download centos Mirror image :
http://www.downcc.com/soft/504962.html
2.cmder How to switch to the specified directory ?
If it is the default bash, Can directly cd /d/myworkstation
If I use theta cmd Pattern , Can directly :
d:
cd D:\daima\virtualenvs\pythonProject
边栏推荐
- 2022年Q1手机银行用户规模达6.5亿,加强ESG个人金融产品创新
- Web网页自动化实战《1.利用py第三方库selenium完成艺龙网访问操作》
- 旭日图有效展示数据的层级和归属关系
- Apple was fined by Dutch regulators, totaling about RMB 180million
- A pit trodden in the equivalence comparison of integer
- Gmail: how to track message reading status
- What is the difference between everything, gnomelive, kdelive, livecd and netinstall in the image?
- CVPR2022|用魔法打败魔法,网易互娱AILab图像鉴伪新方法破解伪造人脸
- 『忘了再学』Shell流程控制 — 36、for循环介绍
- The out of the box caching function of angular server-side rendering applications
猜你喜欢

Isn't this another go bug?

使用NMT和pmap解决JVM资源泄漏问题

Native JS routing, iframe framework

GO语言-type关键字

The third child is here at last! General intelligent planning platform - APS module

The rising sun chart effectively shows the hierarchy and ownership of data

对Integer进行等值比较时踩到的一个坑

真香!十五分钟搞定智能标注、模型训练、服务部署……

GO语言-方法

去中心化游戏如何吸引传统玩家?
随机推荐
Wireshark抓包分析SSL握手的过程
Turn off WordPress auto thumbnail
堪称神作!啃透这份JVM笔记,轻松搞定阿里30K面试!
What has paileyun done to embrace localization and promote industrial Internet?
TypeScript(6)函数
Go language - pointer
GO语言-结构体
Native JS routing, iframe framework
高级性能测试系列《6.问题解答、应用的发展》
What is the difference between everything, gnomelive, kdelive, livecd and netinstall in the image?
What's wrong with the if judgment of pbootcms and the direct display of labels?
Blazor overview and routing
2 万字 + 30 张图 | 细聊 MySQL undo log、redo log、binlog 有什么用?
Soul app focuses on the social needs of generation Z and has won many awards for its outstanding performance in 2021
【贪心】leetcode1005K次取反后数组后的最大值
小蓝做实验(统计质数个数)
使用APICloud实现文档下载和预览功能
依靠可信AI的鲁棒性有效识别深度伪造,帮助银行对抗身份欺诈
Research Report on the overall scale, major manufacturers, major regions, products and application segmentation of floor mounted laboratory centrifuges in the global market in 2022
The key points of the article get to solid principle