微信小程序post请求数据传送不出去

methodget 方式的时候,header

{"Content-Type": 'application/json'}

methodpost 时,header

{"Content-Type": "application/x-www-form-urlencoded"}

wx:request

javascript 复制代码
wx.request({
	url: 'http://...www/runxiang_yiyao/Mobile/Index/login',
	method: 'post',
	data: util.json2Form({
	username: e.detail.value.username,
	password: e.detail.value.password,
	}),
	
	header: {
	"Content-Type": "application/x-www-form-urlencoded"
	},
	success: function (res) {
		console.log(util.formatTime)
		// console.log(res)
	}
})

参考:微信小程序wx.request 使用 post方式传参

相关推荐
闹小艾30 分钟前
教培机构线上线下课程小程序开发:构建数字化教育新生态
小程序
wx_cxc28486989181 小时前
物业后勤小程序源码介绍
微信小程序·小程序
abigale036 小时前
【b站计算机拓荒者】【2025】微信小程序开发教程 - 3 项目目录结构
微信小程序·小程序
DonciSacer16 小时前
APP&小程序抓包和下游代理
web安全·小程序
荷花微笑17 小时前
小程序涉及提供提供文本深度合成技术,请补充选择:深度合成-AI问答类目
小程序
weixin_lynhgworld17 小时前
剧本杀小程序:指尖上的沉浸式推理宇宙
小程序
PyAIGCMaster17 小时前
第三个小程序动工:一款结合ai的菜谱小程序
小程序
砂川同学18 小时前
STM32+ESP8266+ONENET+微信小程序上传数据下发指令避坑指南
stm32·嵌入式硬件·微信小程序
ywyy679821 小时前
微小店推客系统开发:构建全民营销矩阵,解锁流量增长密码
人工智能·搜索引擎·微信小程序·系统·短剧·推客系统·微小店
老李不敲代码1 天前
榕壹云上门家政系统:基于Spring Boot+MySQL+UniApp的全能解决方案
spring boot·mysql·微信小程序·小程序·uni-app