博客
关于我
用postman测试url参数
阅读量:319 次
发布时间:2019-03-04

本文共 482 字,大约阅读时间需要 1 分钟。

const http = require('http');const querystring = require('querystring');http.createServer((req,res)=>{       if(req.url.startsWith('/login')){           let pdata = '';        req.on('data',(chunk)=>{               pdata += chunk;        });        req.on('end',()=>{               let obj = querystring.parse(pdata);            res.end(obj.id+' ---- '+obj.name);        })    }}).listen(3000,()=>{       console.log('server is on!');})

postman测试时候要选x-www-form-urlencoded,不然会有其他信息出现

在这里插入图片描述

转载地址:http://ontq.baihongyu.com/

你可能感兴趣的文章
NewspaceGPT的故事续写能力太强了
查看>>
NewspaceGPT绘制时序图
查看>>
NewspaceGPT绘制类图
查看>>
new一个对象的过程
查看>>
new和delete用法小结
查看>>
new对象时,JVM内部究竟藏了什么小秘密?
查看>>
new操作符的实现原理
查看>>
Next.js React Server Components 教程
查看>>
NextGen Mirth Connect XStream反序列化远程代码执行漏洞(CVE-2023-43208)
查看>>
next项目部署到服务器pm2进程守护
查看>>
nexus 介绍
查看>>
nexus上传jar
查看>>
Nexus指南中的更新强调集成和透明度的重要性
查看>>
Nexus指南已经发布
查看>>
Nexus(1):Nexus的安装与配置
查看>>
NFC技术:概述
查看>>
NFinal学习笔记 02—NFinalBuild
查看>>
NFS
查看>>
nfs mount 故障 mount.nfs: access denied by server while mounting 10.0.100.208:/backup_usb
查看>>
NFS Server及Client配置与挂载详解
查看>>