localhost

http 协议 相关知识 --请求

一笑奈何 提交于 2020-03-18 17:19:27
3 月,跳不动了?>>> 一:什么是http协议: http协议: 对浏览器客户端 和 服务器端 之间数据传输的格式规范 二:查看http协议的工具   1)使用火狐的firebug插件(右键->firebug->网络)   2)使用谷歌的“审查元素”   3)使用系统自带的telnet工具(远程访问工具)     a)telnet localhost 8080 访问tomcat服务器     b)ctrl+] 回车 可以看到回显     c)输入请求内容      GET /day09/hello HTTP/1.1 Host: localhost: 8080     d)回车,即可查看到服务器响应信息。 三:http协议内容 请求(浏览器- 》服务器) GET /day09/hello HTTP/1.1 Host: localhost: 8080 User -Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:35.0) Gecko/20100101 Firefox/35.0 Accept: text /html,application/xhtml+xml,application/xml;q=0.9,* /* ;q=0.8 Accept-Language: zh-cn,en-us;q=0.8,zh;q=0.5,en;q=0.3 Accept

384 json-server, axios

一世执手 提交于 2020-03-18 13:44:38
使用接口的形式发送数据 一 、json-server 提供假数据接口 json-server 作用 : 根据指定的 JSON 文件, 提供假数据接口 地址 : json-server 使用步骤 1. 全局安装 json-server : `npm i -g json-server` 2. 准备一个json数据 3. 执行 : `json-server data.json` > json数据参考 json数据可以参考 : { "todos": [ { "id": 1, "name": "吃饭", "age": 20 } ] } REST API 格式 * 1. 查询 : GET * 2. 添加 : POST * 3. 删除 : DELETE * 4. 更新 : PUT 或者 PATCH(打补丁) 具体接口 * 1. 查询全部数据 http://localhost:3000/todos * 查询指定数据 http://localhost:3000/todos/2 * * 2. 添加一个对象 //localhost:3000/todos * POST * id 会自动帮我们添加 【不用写id。】 * * 3. 更新数据 http://localhost:3000/todos/3 * PUT 或者 PATCH * PUT 需要提供该对象的所有数据 * PATCH 只需要提供要修改的数据即可

Post returns 405 method not allowed

走远了吗. 提交于 2020-03-18 10:59:53
问题 I am having an issue with my Rails localhost Server, all Post calls started returning 405 method not allowed. However there are no problems on our staging and production servers . It is happening on all branches of code even ones that have not been updated. When debugging I see that it reaches the routes file but not the controller. I have tried removing my gems and reinstalling, switching from WEBrick to Pama, creating a new clone of my git project. Server Started POST "/assets" for ::1 at

Post returns 405 method not allowed

偶尔善良 提交于 2020-03-18 10:59:02
问题 I am having an issue with my Rails localhost Server, all Post calls started returning 405 method not allowed. However there are no problems on our staging and production servers . It is happening on all branches of code even ones that have not been updated. When debugging I see that it reaches the routes file but not the controller. I have tried removing my gems and reinstalling, switching from WEBrick to Pama, creating a new clone of my git project. Server Started POST "/assets" for ::1 at

CentOS 6.5 伪分布式 安装 hadoop 2.6.0

为君一笑 提交于 2020-03-18 07:35:39
安装 jdk 1 yum install java-1.7.0-openjdk* 3 检查安装:java -version 创建Hadoop用户,设置Hadoop用户使之可以免密码ssh到localhost 1 su - hadoop 2 ssh-keygen -t dsa -P '' -f ~/.ssh/id_dsa 3 cat ~/.ssh/id_dsa.pub>> ~/.ssh/authorized_keys 4 5 cd /home/hadoop/.ssh 6 chmod 600 authorized_keys 注意这里的权限问题,保证.ssh目录权限为700,authorized_keys为600 验证: 1 [hadoop@localhost .ssh]$ ssh localhost 2 Last login: Sun Nov 17 22:11:55 2013 解压hadoop,安装在/opt/hadoop 1 tar -xzvf hadoop-2.6.0.tar.gz 2 mv -i /home/erik/hadoop-2.6.0 /opt/hadoop 3 chown -R hadoop /opt/hadoop 要修改的文件有hadoop-env.sh、core-site.xml 、 hdfs-site.xml 、 yarn-site.xml 、mapred

解决:mybatis-generator-maven-plugin:1.3.2:generateAccess denied for user 'root'@'localhost'

时光怂恿深爱的人放手 提交于 2020-03-17 18:52:50
问题描述 Failed to execute goal org.mybatis.generator:mybatis-generator-maven-plugin:1.3.7:generate (default-cli) on project springboot_v2: Access denied for user ‘root’@‘localhost’ (using password: YES) Failed to execute goal org.mybatis.generator:mybatis-generator-maven-plugin:1.3.7:generate ( default-cli ) on project springboot_v2: Access denied for user 'root' @ 'localhost' ( using password: YES ) 可能原因 1、root用户没有权限访问该数据库并进行表的增删改查操作 解决方案 修改root用户在该数据库的权限,即添加相应权限 在navicat中新建查询执行以下代码 GRANT Alter , Alter Routine , Create , Create Routine , Create Temporary Tables , Create View , Delete , Drop ,

HTML5 postMessage 跨域交换数据

帅比萌擦擦* 提交于 2020-03-17 09:21:06
某厂面试归来,发现自己落伍了!>>> 今天我们来学习一下HTML5的api,利用postMessage来跨域交换数据。和前面一些方式交换数据方式不同的是,利用postMessage 不能和服务端交换数据 , 只能在两个窗口(iframe)之间交换数据 ,废话不多说,我们直接进入实战。 实战postMessage overview   上文中说,postMessage是用于两个窗口(iframe)之间交换数据的,如果我们同时打开着百度和谷歌两个页面,是不是说这两者之间就可以通信了?No,no,no,事实并非如此,就算百度和谷歌俩页面有通信的意愿也不行。 两个窗口能通信的前提是,一个窗口以iframe的形式存在于另一个窗口,或者一个窗口是从另一个窗口通过window.open()或者超链接的形式打开的(同样可以用window.opener获取源窗口) ;换句话说,你要交换数据,必须能获取目标窗口(target window)的引用,不然两个窗口之间毫无联系,想通信也无能为力。   既然是H5家族的,我们也得观望下它被广大浏览器的接受程度,可以看到接受程度还是相当高的:   而postMessage的使用方式也相当简单: otherWindow.postMessage(message, targetOrigin, [transfer]);   otherWindow是对接收方窗口的引用

escape和encodeURI和encodeURIComponent使用场景和区别

随声附和 提交于 2020-03-17 03:17:33
函数出现时间: escape() javascript 1.0 encodeURI() javascript 1.5 encodeURIComponent() javascript 1.5 函数功能介绍: escape() : 采用ISO Latin字符集对指定的字符串进行编码。所有的空格符、标点符号、特殊字符以及其他非ASCII字符都会转化成%xx格式的字符编码(xx代表此字符在字符集表里编码的16进制数字)。比如,空格符的对应编码是%20。不会对ASCII字符和数字进行编码。不会被此方法编码的字符:@ * / +,反向编码函数:unescape()。 encodeURI(): 把URI字符串采用UTF-8编码格式转化成escape格式的字符串。不会被此方法编码的字符:! @ # $ & ( ) = : / ; ? + ',反向编码函数:decodeURI()。 encodeURIComponent():把URI字符串采用URF-8编码格式转化成escape格式的字符串。与encodeURI相比,这个函数会将更多的字符进行编码,比如"/"等字符。所以如果字符串里面包含了URI的几个部分的话,不能用这个来进行编码。否则“/”字符被编码后将URL显示错误。不会被此方法编码的字符:! * ( ),反向编码函数:decodeURIComponent()。 测试demo: var url

MySQL授权root

为君一笑 提交于 2020-03-17 03:04:41
1。 改表法。 可能是你的帐号不允许从远程登陆,只能在localhost。这个时候只要在localhost的那台电脑,登入mysql后,更改 "mysql" 数据库里的 "user" 表里的 "host" 项,从"localhost"改称"%" mysql -u root -pvmwaremysql>use mysql; mysql>update user set host = '%' where user = 'root'; mysql>select host, user from user; 2. 授权法。 例如,你想myuser使用mypassword从任何主机连接到mysql 服务器 的话。 GRANT ALL PRIVILEGES ON *.* TO 'myuser'@'%' IDENTIFIED BY 'mypassword' WITH GRANT OPTION; FLUSH PRIVILEGES; 如果你想允许用户myuser从ip为192.168.1.6的主机连接到mysql 服务器 ,并使用mypassword作为密码 GRANT ALL PRIVILEGES ON *.* TO 'myuser'@'192.168.1.3' IDENTIFIED BY 'mypassword' WITH GRANT OPTION; FLUSH PRIVILEGES;

Python3 MySQL 数据库连接 -PyMySQL

我与影子孤独终老i 提交于 2020-03-16 18:36:32
Python 3 操作mysql http://www.runoob.com/python3/python3-mysql.html Python3 MySQL 数据库连接 本文我们为大家介绍 Python3 使用 PyMySQL 连接数据库,并实现简单的增删改查。 什么是 PyMySQL? PyMySQL 是在 Python3.x 版本中用于连接 MySQL 服务器的一个库,Python2中则使用mysqldb。 PyMySQL 遵循 Python 数据库 API v2.0 规范,并包含了 pure-Python MySQL 客户端库。 PyMySQL 安装 在使用 PyMySQL 之前,我们需要确保 PyMySQL 已安装。 PyMySQL 下载地址:https://github.com/PyMySQL/PyMySQL。 如果还未安装,我们可以使用以下命令安装最新版的 PyMySQL: $ pip install PyMySQL 如果你的系统不支持 pip 命令,可以使用以下方式安装: 1、使用 git 命令下载安装包安装(你也可以手动下载): $ git clone https://github.com/PyMySQL/PyMySQL $ cd PyMySQL/ $ python3 setup.py install 2、如果需要制定版本号,可以使用 curl 命令来安装: $