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 ...
随机推荐
- 集合 HashMap 的原理,与 Hashtable、ConcurrentHashMap 的区别
一.HashMap 的原理 1.HashMap简介 简单来讲,HashMap底层是由数组+链表的形式实现,数组是HashMap的主体,链表则是主要为了解决哈希冲突而存在的,如果定位到的数组位置不含链表 ...
- selenium3与Python3实战 web自动化测试框架✍✍✍
selenium3与Python3实战 web自动化测试框架 整个课程都看完了,这个课程的分享可以往下看,下面有链接,之前做java开发也做了一些年头,也分享下自己看这个视频的感受,单论单个知识点课 ...
- 伪类checked
困惑了好久的复选框自定义样式终于有了谜底,原来就是一个 :checked 伪类 他的意思就是 匹配任意被勾选/选中的radio(单选按钮),chexked(复选框),或者option(select项) ...
- 用selenium 自动爬取某一本小说章节及其内容,并存入数据库中
from selenium import webdriver import pymysql from selenium.webdriver.support.ui import WebDriverWai ...
- nodejs 模板引擎ejs的简单使用(3)
1.ejs <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <tit ...
- vue computed和methods 计算属性和侦听器
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title> ...
- Redis探索之路(六):Redis的常用命令
一:键值相关命令 1.keys Pattern模糊查询 keys my* 2.exists某个key是否存在 exists key1 3.del 删除一个key del key1 4.expire设置 ...
- Python自学:第四章 遍历切片
# -*- coding: GBK -*- players = ['charles', 'martina', 'michael', 'florence', 'eli'] print("Her ...
- GlobalExceptionHandler 捕获抛出的异常,返回特定值给前端
/** * @author hhh * @date 2019/1/17 16:28 * @Despriction */ @ResponseBody @ControllerAdvice @Log4j2 ...
- Java中的线程Thread方法之---interrupt()
前几篇都介绍了Thread中的几个方法,相信大家都发现一个相似点,那就是sleep,join,wait这样的阻塞方法都必须捕获一个InterruptedException异常,顾名思义就是一个线程中断 ...