微信小程序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方式传参

相关推荐
racerun3 小时前
微信小程序如何实现再多个页面共享数据
微信小程序·小程序
XM-54584 小时前
2025微信小程序wxapkg解包全攻略
linux·运维·小程序
HERR_QQ1 天前
【unify】unify的微信小程序开发学习 (to be continued)
学习·微信小程序·小程序
racerun2 天前
小程序导航设置更多内容的实现方法
小程序
说私域2 天前
基于开源AI智能名片链动2+1模式S2B2C商城小程序的超级文化符号构建路径研究
人工智能·小程序·开源
mg6682 天前
微信小程序入门实例_____快速搭建一个快递查询小程序
微信小程序·小程序
程序员柳2 天前
基于微信小程序的校园二手交易平台、微信小程序校园二手商城源代码+数据库+使用说明,layui+微信小程序+Spring Boot
数据库·微信小程序·layui
Jyywww1212 天前
微信小程序学习笔记
笔记·学习·微信小程序
The_era_achievs_hero2 天前
微信小程序41~50
微信小程序·小程序