postman连接不了localhost问题解决
学习搭建服务器可用postman 连接不了localhost的端口
网上好多教程是这样连接

看完视频后我们是这样

找了大量资料都解决不了,什么版本,什么证书的都不好使,最简单的就是去掉http://

//get 测试
const http=require('http')
const querystring=require('querystring')
const server=http.createServer((req, res)=>{
//GET
console.log('method',req.method)
const url=req.url
// /
console.log('url:',url)
req.query=querystring.parse(url.split('?')[])
console.log('query:',req.query)
res.end(
JSON.stringify(req.query)
)
})
server.listen()
console.log('测试get')
node get
const http=require('http')
const server=http.createServer((req, res) =>{
if(req.method==='POST'){
console.log('content-type',req.headers['content-type'])
let postData=""
req.on('data',chunk=>{
postData+=chunk.toString()
})
req.on('end',()=>{
console.log(postData)
res.end('post请求执行结束')
})
}
})
server.listen();
console.log('post请求执行开始')
node post
测试代码
postman连接不了localhost问题解决的更多相关文章
- SQLServerException:通过端口 1433 连接到主机 localhost 的 TCP/IP 连接失败。
一.问题描述: 1.连接数据库时抛出的异常: com.microsoft.sqlserver.jdbc.SQLServerException: 通过端口 1433 连接到主机 localhost 的 ...
- postman连接mysql执行操作
postman也可以连接mysql 目录 1.安装 2.启动服务 3.执行sql语句 1.安装 想要postman连接mysql,需要安装xmysql,启动该服务,然后才可以调用. 预置条件:完成no ...
- 【转】Java JDBC连接SQL Server2005错误:通过端口 1433 连接到主机 localhost 的 TCP/IP 连接失败
错误原因如下: Exception in thread "main" org.hibernate.exception.JDBCConnectionException: Cannot ...
- Java JDBC连接SQL Server2005错误:通过port 1433 连接到主机 localhost 的 TCP/IP 连接失败
错误原因例如以下: Exception in thread "main" org.hibernate.exception.JDBCConnectionException: Cann ...
- Java JDBC连接SQL Server2005错误:通过端口 1433 连接到主机 localhost 的 TCP/IP 连接失败 及sql2008外围服务器
转载:Java JDBC连接SQL Server2005错误:通过端口 1433 连接到主机 localhost 的 TCP/IP 连接失败 错误原因如下: Exception in thread & ...
- mysql Access denied for user 'root'@'localhost'问题解决
问题描述: 系统安装mysql的过程中,没有提示配置用户名和密码相关的信息,安装完毕后,登录报错. 表现现象为: mysql -u root -p [输入root密码] 界面提示: ERROR 169 ...
- orcal数据库得连接必须用localhost,url中不要用127.0.0.1,不然无法连接
orcal数据库得连接必须用localhost,url中不要用127.0.0.1,不然无法连接,
- Can't connect to MySQL server on 'localhost' (10061),连接Navicat报错问题解决
今天,装了Mysql 1.1.7后,连接Navicat 时报错,后来找了一阵,发现问题所在. 原因是我在安装时把默认端口号3306修改成了3303, 连接时,把默认端口也修改下就好啦.
- Redis安装以及Java客户端jedis连接不上相关问题解决
安装步骤 1.由于Redis是由C 语言编写的 所以虚拟机编译需要C的编译环境 用命令 yum install gcc-c++ 2.用SFTP上传Redis安装包并解压 3.进入Redis源码目录 b ...
随机推荐
- 6.2_springboot2.x分布式整合Dubbo
1.分布式应用 在分布式系统中,国内常用zookeeper+dubbo组合,而Spring Boot推荐使用全栈的Spring,Spring Boot+Spring Cloud. 分布式系统: 特 ...
- python库argparse中type的新奇指定方法
最近在看一些项目的源码,总是能学到好多东西. 关于arparse中type的类型指定 不止可以指定常规类型,还可以加一些自己类型判断,具体用法如下(来源): def str2bool(v): &quo ...
- akka-stream之异常处理
背景介绍 在项目中使用了akk-stream的source.queue功能,如下: Pair<SourceQueueWithComplete<Integer>, Source< ...
- pytest_fixture--scope="session"
import pytest@pytest.fixture(scope="session")def login(): print("\n输入用户名密码登陆! configt ...
- 使用JMeter进行http压力测试
一.背景及文档目的说明 采用JMeter测试工具对腾讯视频做负载测试,使用 JMeter图形结果和聚合图帮助测试系统在资源超负荷情况下的表现,以发现设计上的错误或验证系统的负载能力并估计系统瓶颈和并发 ...
- 利用left join 筛选B表中不包含A表记录
select A.key from A LEFT JOIN B ON A.KEY=B.KEY WHERE B.FIELD IS NULL;
- shell实现批量创建交叉编译工具软链接
在学习嵌入式过程中,常常用到交叉编译工具,而原本的交叉工具链比较长,不利于记忆以及使用, 解压后的交叉编译工具链如下图所示 为了更好的使用交叉编译工具与其他开发者保持一致,经常需要用到软链接. NAM ...
- nodejs mysql 连接数据库
1.设计数据库 2.设计数据库表 3.下载MySQL模块 npm install --save mysql 4.编写代码 const mysql=require('mysql'); //1.连接 // ...
- zepto-touch事件
<!doctype html> <html> <head> <meta charset="UTF-8"> <title> ...
- 解析Mybatis入门第一天
MyBatis是一个基于Java的持久层框架,内部对JDBC做了封装,使开发者只需要关注SQL语句,而不用关注JDBC的代码,使开发变得更加的简单. MyBatis通过XML或者注解的方式将要执行的各 ...