当前位置:网站首页>From client to server
From client to server
2022-06-24 23:18:00 【13 less】
When we send a request , From client to server , What have you experienced ?
One . Considerations for invoking interfaces
Our focus is on the requested address , Requested method ,tokne, Request header , Requested parameters , Request type , These things can be seen in the console . When our request fails , Don't rush to the back end , First determine whether the address of your request is correct , The requested method is incorrect , And the transfer of parameters , When there is no problem, the data is still unavailable , We can ask questions before it's too late , Always keep the interface document handy for easy viewing .
(1) See the position of parameters

(2) Where the response data is
Both of them can see the returned data
(3) The requested method and address

(4) Request header
It's storing token And some information that contains the request

Two .x-www-form-urlencoded and form-data and raw The difference between
Position of being :
3、 ... and . Status code returned by the server
Usually, the front-end call is accompanied by the back-end status code , To determine whether the data has been returned successfully , And whether the operation was successful .
Common status codes :
2xx Return to success Or the operation is successful
3xx Represents the redirection problem
4xx Parameter error weight insufficient Parameter error
5xx The server crashed
(1) I have talked about Dang in previous articles token When it fails, the user does not have permission to access it ,token When it fails
Status code from 2xx become 4xx Insufficient authority , You can do something at this time token Treatment of failure . The status code is not fixed, but can be set by the backend
(2) When to return to 2xx When
It indicates that the request or operation is successful . Interface call successful .
边栏推荐
- Mycms we media CMS V3.0, resource push optimization, new free template
- 【js】-【树】-学习笔记
- 378. 骑士放置
- Dig deep into MySQL - resolve the clustered index / secondary index / federated index of InnoDB storage engine
- Financial management [5]
- laravel学习笔记
- Non single file component
- laravel用户授权
- Financial management [2]
- No main manifest attribute in jar
猜你喜欢

花房集团二次IPO:成于花椒,困于花椒

【js】-【數組、棧、隊列、鏈錶基礎】-筆記

Non single file component

07_ Springboot for restful style

InnoDB, the storage engine of MySQL Architecture Principle_ Redo log and binlog

并发之共享模型管程

Tech talk activity review kubernetes skills of cloud native Devops

laravel 宝塔安全配置

Uncover the secrets of Huawei cloud enterprise redis issue 16: acid'true' transactions beyond open source redis

Servlet
随机推荐
数字IC设计经验整理(二)
Canvas to add watermark to pictures
Selection (028) - what is the output of the following code?
从客户端到服务器
2022 safety officer-a certificate examination questions and answers
Sword finger offer 42 Maximum sum of successive subarrays
laravel 消息队列
Collation of Digital IC design experience (II)
Theoretical analysis of countermeasure training: adaptive step size fast countermeasure training
378. 骑士放置
Dig deep into MySQL - resolve the non clustered index of MyISAM storage engine
宁德时代定增450亿:高瓴认购30亿 曾毓群仍控制23%股权
A big factory interview must ask: how to solve the problem of TCP reliable transmission? 8 pictures for you to learn in detail
案例解析:用「度量」提升企业研发效能|ONES Talk
Detailed explanation of online group chat and dating platform project (servlet implementation)
Online group chat and dating platform test point
docker-mysql8-主从
07_SpingBoot 实现 RESTful 风格
Laravel 认证模块 auth
idea创建模块提示已存在

