url

Git submodule url changed

ε祈祈猫儿з 提交于 2020-01-26 20:31:04
问题 I have a Git project which has a submodule. The url of the submodule was recently changed. I have changed the .gitmodules and config file to point to the new url. Should I commit the .gitmodules file so that the next time I checkout my project and do git submodule update --init --recursive I won't get an error? 回答1: Yes, after editing .gitmodules , you should commit and push those changes, so the change becomes available to everyone. Otherwise, only your local submodule would point to the new

初步了解URL

帅比萌擦擦* 提交于 2020-01-26 18:14:52
URl的定义:   在webs上每种可用的资源(比如:HTML文档,图像,视频片段,程序等)都可以由一个通用的资源标志符(Universal Resource Identifier)进行定位。 URl的组成: 1.访问资源的命名机制 2.存放资源的主机名 3.资源自身的名称,由路径表示。 第一部分和第二部分用"://"隔开,第二部分和第三部分用“/隔开” 如:http//www.xxx.com.cn/index.html 以上URL可以解释为:这是一个通过HTTp协议访问的资源,位置主机为www.xxx.com.cn上,通过路径“index.html”访问。 来源: https://www.cnblogs.com/lin494910940/p/12234484.html

How to get the value after the hash in “somepage.php#name”?

情到浓时终转凉″ 提交于 2020-01-26 10:54:50
问题 For a given url, I want to get the name-after-hash's age from the database. so for url like thepage.php#Madonna , you'll see " 119! ". How can I extract the value after the hash in a url? (i need a safe all-browser-compatible-NON-JAVASCRIPT way). I want to do that like $_GET['after hash']. The reason I'm not using GET is because I want to use AJAX and jquery's history plugin. Basically what i want is to use ajax to retrieve data from the server according to the value assigned after the hash.

postman教程(1)

北慕城南 提交于 2020-01-26 10:12:58
Postman介绍 Postman是google开发的一款功能强大的网页调试与发送网页HTTP请求,并能运行测试用例的的Chrome插件。其主要功能包括: 模拟各种HTTP requests 从常用的 GET、POST 到 RESTful 的 PUT 、 DELETE …等等。 甚至还可以发送文件、送出额外的 header。 Collection 功能(测试集合) Collection 是 requests的集合,在做完一個测试的時候, 你可以把這次的 request 存到特定的 Collection 里面,如此一來,下次要做同样的测试时,就不需要重新输入。而且一个collection可以包含多条request,如果我们把一个request当成一个test case,那collection就可以看成是一个test suite。通过collection的归类,我们可以良好的分类测试软件所提供的API.而且 Collection 还可以 Import 或是 Share 出來,让团队里面的所有人共享你建立起來的 Collection。 人性化的Response整理 一般在用其他工具來测试的時候,response的内容通常都是纯文字的 raw, 但如果是 JSON ,就是塞成一整行的 JSON。这会造成阅读的障碍 ,而 Postman 可以针对response内容的格式自动美化。 JSON

In node.js how to get/construct URL string from WHATWG URL including user and password but nothing after host

空扰寡人 提交于 2020-01-26 04:05:27
问题 What would be the recommended way of deriving the following: https://user:pass@hostname:port From: https://user:pass@hostname:port/p/a/t/h?q=whatevere#hash when dealing with node.js url module using current WHATWG URL ? 回答1: Pretty sure you can use standard javascript with node.js var s = 'https://user:pass@hostname:port/path#hash'; s = s.substring(0, s.lastIndexOf('/')); That should give you s as the value you want. Caz Update - You could also do this if you can't predict the number of / in

urlparse (scheme、netloc、path等)

梦想与她 提交于 2020-01-26 02:19:55
python2 from urllib2 import urlparse python3 from urlib.parse import urlparse >>> url = "http://localhost/test.py?a=hello&b=world " >>> from urlib2 import urlparse Traceback (most recent call last): File "<stdin>", line 1, in <module> ImportError: No module named urlib2 >>> from urllib2 import urlparse >>> result = urlparse.urlparse(url) >>> result ParseResult(scheme='http', netloc='localhost', path='/test.py', params='', query='a=hello&b=world ', fragment='') result.scheme : 网络协议 result.netloc: 服务器位置(也有可能是用户信息) result.path: 网页文件在服务器中的位置 result.params: 可选参数 result.query: &连接键值对 result.fragment

PHP用户注册邮箱验证激活帐号

佐手、 提交于 2020-01-26 01:36:22
http://www.helloweba.com/view-blog-228.html 我们在很多网站注册会员时,注册完成后,系统会自动向用户的邮箱发送一封邮件,这封邮件的内容就是一个URL链接,用户需要点击打开这个链接才能激活之前在该网站注册的帐号。激活成功后才能正常使用会员功能。 查看演示 下载源码 本文将结合实例,讲解如何使用PHP+Mysql完成注册帐号、发送激活邮件、验证激活帐号、处理URL链接过期的功能。 业务流程 1、用户提交注册信息。 2、写入数据库,此时帐号状态未激活。 3、将用户名密码或其他标识字符加密构造成激活识别码(你也可以叫激活码)。 4、将构造好的激活识别码组成URL发送到用户提交的邮箱。 5、用户登录邮箱并点击URL,进行激活。 6、验证激活识别码,如果正确则激活帐号。 准备数据表 用户信息表中字段Email很重要,它可以用来验证用户、找回密码、甚至对网站方来说可以用来收集用户信息进行Email营销,以下是用户信息表t_user的表结构: CREATE TABLE IF NOT EXISTS `t_user` ( `id` int(11) NOT NULL AUTO_INCREMENT, `username` varchar(30) NOT NULL COMMENT '用户名', `password` varchar(32) NOT NULL

HttpSession详解

試著忘記壹切 提交于 2020-01-26 00:47:58
session的机制    http 是无状态的协议,客户每次读取 web 页面时,服务器都打开新的会话,而且服务器也不会自动维护客户的上下文信息,那么要怎么才能实现会话跟踪呢? session 就是一种保存上下文信息的机制,它是针对每一个用户的,变量的值保存在服务器端,通过 SessionID 来区分不同的客户 ,session 是以 cookie 或 URL 重写为基础的,默认使用 cookie 来实现,系统会创造一个名为 JSESSIONID 的输出返回给客户端Cookie保存。 保存session id的几种方式    A.保存session id的方式可以采用cookie,这样在交互过程中浏览器可以自动的按照规则把这个标识发送给服务器。   B.由于cookie可以被人为的禁止,必须有其它的机制以便在cookie被禁止时仍然能够把session id传递回服务器,经常采用的一种技术叫做 URL重写,就是把session id附加在URL路径的后面,附加的方式也有两种,一种是作为URL路径的附加信息,另一种是作为查询字符串附加在URL后面。网络在整个交互过程中始终保持状态,就必须在每个客户端可能请求的路径后面都包含这个session id。   C.另一种技术叫做 表单隐藏字段。就是服务器会自动修改表单,添加一个隐藏字段,以便在表单提交时能够把session

URL rewrite PHP & pulls data from a MySql DB

北慕城南 提交于 2020-01-25 23:07:33
问题 I have a site tha is written in PHP and pulls data from a MySql DB. The site utilises query strings and I would like to map the query generated pages to the more search engine friendly page titles. For example I would like to acheive to the following mappings: content.php?id=1 to map to /aboutus content.php?id=2 to map to /contactus content.php?id=3 to map to /newfiles how can i do this, in a more simple way. is that simply changing .htaccess file, or is that related to rewrite mapping

Header解析

自闭症网瘾萝莉.ら 提交于 2020-01-25 22:19:34
不管是作为后端还是前端开发人员,对于web请求的过程和参数都是需要了解的。 下面是对一次简单的http请求的header分析,作为自己的一个总结,也希望对大家有所帮助。 以Chrome为例: 我们对header的参数挨个分析 General Request URL: http://localhost:88/ 这里需要了解的是URI的结构,URI和URL详细请参考 这里 需要注意的地方:锚点(永远不会发到服务器端)URI和URL的区别:URL是URI最常见的一种形式,URL的协议(http/https/ssh/ftp/wss/mailto) Request Method: GET 请求方法除了常见的GET,POST,PUT,DELETE,还包括如下:HEAD:请求获取由Request-URI所标识的资源的响应消息报头CONNECT:保留OPTIONS:请求查询服务器的性能,或者查询与资源相关的选项和需求TRACE:请求服务器回送收到的请求信息,主要用于测试或诊断 参考: https://developer.mozilla.org/zh-CN/docs/Web/HTTP/Methods Status Code: 200 OK 状态码需要了解的大致如下: 1xx:服务器收到信息,等待请求者继续(100:contine,101:协议切换) 2xx:接受并操作成功(200,201