当前位置:网站首页>Uni app sends request instructions using the escook / request miniprogram plug-in
Uni app sends request instructions using the escook / request miniprogram plug-in
2022-06-27 12:14:00 【Voiceless】
Request description :
According to the interface requirements , The commonly used request type is get Request and post request
get The writing method of non - parameter
//res Is the data returned by the interface , May contain 1. Request result status (success)2. data (data)3. Tips (message)
//get request uni.$http.get;post request uni.$http.post
// Request path :/home/Img/goods_video.( This interface is only an example , If you write it yourself, you need to write it according to the actual interface document )
const { data: res } = await uni.$http.get('/home/Img/goods_video')
/* for example :res The data returned is
{
"success": 1, // Successful response
"message": " To be successful ",
"data": [
{
"id": 426,
"goods_name": " Push the spiral triangle iron ",
"phone": ""
}
]
}
*/
if (res.success !== 1){
return uni.$showMsg()
}else{
//List For custom parameters ;res.data Represents the returned using the interface data Data assignment in
this.List = res.data
}
get The ginseng
//params For custom , It can also be called data, But still params Easier to understand , The parameters can be multiple , Design according to the requirements of interface documents
//search_name Is the request parameter name , This is just an example , The actual parameter name can be written according to the requirements of the interface document
// man 's suit , Request parameter value
var params = {
search_name:' man 's suit '
}
const { data: res } = await uni.$http.get('/api/public/v1/home/swiperdata',params)
if (res.success !== 1){
return uni.$showMsg()
}elses{
this.List2 = res.data
}
post Don't pass it on
const { data: res } = await uni.$http.post('/home/Infor/newselect')
if (res.success !== 1){
return uni.$showMsg()
}elses{
this.List2 = res.data
}post The ginseng
var params = {
id:123
}
const { data: res } = await uni.$http.post('/home/Infor/newselect2',params)
if (res.success !== 1){
return uni.$showMsg()
}elses{
this.List2 = res.data
}边栏推荐
- [tcapulusdb knowledge base] tcapulusdb doc acceptance - Introduction to creating game area
- How histrix works
- In 2021, the global professional liability insurance revenue was about USD 44740million, and it is expected to reach USD 55980million in 2028. From 2022 to 2028, the CAGR was 3.5%
- "24 of the 29 students in the class successfully went to graduate school" rushed to the hot search! Where are the remaining five?
- 微服务拆分
- 秒云荣获《2022爱分析 · IT运维厂商全景报告》智能运维AIOps市场代表厂商
- mysql学习1:安装mysql
- R语言使用glm函数构建泊松对数线性回归模型处理三维列联表数据构建饱和模型、使用step函数基于AIC指标实现逐步回归筛选最佳模型、解读分析模型
- Youboxun attended the openharmony technology day to create a new generation of secure payment terminals
- R语言使用epiDisplay包的followup.plot函数可视化多个ID(病例)监测指标的纵向随访图、使用stress.labels参数在可视化图像中为强调线添加标签信息
猜你喜欢

MapReduce原理剖析(深入源码)

How to find the movie and TV clips with the same lines? These 8 movies search for artifact, and find the corresponding segment in one line

AutoCAD - three pruning methods

pull request

Tidb 6.0: making Tso more efficient tidb Book rush

巅峰小店APP仿站开发玩法模式讲解源码分享

Interview shock 60: what will cause MySQL index invalidation?

Interviewer: with the for loop, why do you need foreach?

In 2021, the global carbon graphite brush revenue is about US $2366million, and it is expected to reach US $2701.8 million in 2028

等等, 怎么使用 SetMemoryLimit?
随机推荐
Peak store app imitation station development play mode explanation source code sharing
R language dplyr package arrange function sorts dataframe data, sorts dataframe data through multiple data columns, specifies the first field to be sorted in descending order, and does not specify the
深入理解 happens-before 原则
Don't miss it. New media operates 15 treasure official account to share
[tcapulusdb knowledge base] Introduction to tcapulusdb data structure
The R language uses the follow up The plot function visualizes the longitudinal follow-up map of multiple ID (case) monitoring indicators, and uses stress The labels parameter adds label information t
Time management understood after being urged to work at home
[high frequency interview questions] difficulty 1.5/5, LCS template questions
Dynamic programming [III] (interval DP) stone merging
建木持续集成平台v2.5.0发布
等等, 怎么使用 SetMemoryLimit?
[tcapulusdb knowledge base] tcapulusdb doc acceptance - Introduction to creating game area
记一次 .NET 某物管后台服务 卡死分析
The DBSCAN function of FPC package in R language performs density clustering analysis on data, and the plot function visualizes the clustering graph
The GLM function of R language is used to build a binary logistic regression model (the family parameter is binomial), and the AIC function is used to compare the AIC values of the two models (simple
[tcapulusdb knowledge base] Introduction to tcapulusdb system management
MIT6.031 软件构造 Reading7阅读笔记Designing Specifications(设计规范)
在 Golang 中构建 CRUD 应用程序
Histrix工作原理
Research Report on the overall scale, major producers, major regions, products and application segments of swine vaccine in the global market in 2022