技术栈

URL中传递JSON字符串

小麟有点小靈2023-08-27 21:12

今天遇见了一个需求,从post请求中在url里传递json字符串,

就是路径?参数1=1那种情况

最后怎么解决的呢?

需要使用前端方法,先用JSON.stringify格式化成字符串,再用encodeURIComponent把JSON里面的符号转转为url支持的编码

然后将参数的属性放置对应的值

如下图:

服务端即可接收

上一篇:WebSocket详解以及应用
下一篇:yolov8实战之torchserve服务化:使用yolov8x来预打标
相关推荐
wtsolutions
6 小时前
Understanding Excel Data Formats - What Excel to JSON Supports
ui·json·excel
wtsolutions
10 小时前
Real-World Use Cases - How Organizations Use Excel to JSON
json·github·excel
cab5
10 小时前
MyBatis如何处理数据库中的JSON字段
数据库·json·mybatis
FITA阿泽要努力
10 小时前
动手体验:5min实现第一个智能体——1
json·api·agent·requests·查询天气·pprint·f-string
wtsolutions
11 小时前
Using the Excel to JSON API - Programmatic Access for Developers
ui·json·xhtml
石云升
12 小时前
Claude Code 配置教程:如何通过修改 settings.json 优化 AI 编程体验
人工智能·json
wtsolutions
13 小时前
MCP Service Integration - Excel to JSON for AI and Automation
人工智能·json·excel
cjp560
13 小时前
019.C#管道服务,两软件间用json数据交互
开发语言·c#·json
组合缺一
13 小时前
FastJson2 与 SnackJson4 有什么区别?
java·json·fastjson·snackjson
热门推荐
01GitHub 镜像站点022025 Telegram 最新免费社工库机器人(LetsTG可[特殊字符])搭建指南(含 Python 脚本)03OpenCode 入门教程:介绍 · 安装 · 配置第三方 API (如 Claude)04AI 规范驱动开发“三剑客”深度对比:Spec-Kit、Kiro 与 OpenSpec 实战指南05UV安装并设置国内源06Linux下V2Ray安装配置指南07Labelme从安装到标注:零基础完整指南08Claude Code Skills 实用使用手册09安娜的档案(Anna’s Archive) 镜像网站/国内最新可访问入口(持续更新)10BongoCat - 跨平台键盘猫动画工具