uni-app 网络请求

uni.request发起网络请求json

url
开发者服务器接口地址服务器

data
请求的参数网络

headerapp

method
dataTypeurl

responseType
设置响应的数据类型3d

statusCode 开发者服务器返回的http状态码code

data数听说明orm

<template>
  <view></view>
</template>
// get 

const requestTask1 = uni.request({
 url: ' ',
 success: function(res) {
  console.log(res.data);
 }
});

//

const requestTask2 = uni.request({
 url :''
 data:{},
 method: 'POST',
 header: {'content-type': 'application/x-www-form-urlencoded'},
 success: function(res){
 }

header['content-type'] 为 application/json 的数据,会进行 JSON 序列化

若本号内容有作得不到位的地方(好比:涉及版权或其余问题),请及时联系咱们进行整改便可,会在第一时间进行处理。接口


请点赞!由于大家的赞同/鼓励是我写做的最大动力!

欢迎关注达达的简书!

这是一个有质量,有态度的博客开发

博客

相关文章
相关标签/搜索