{"id":584,"date":"2019-09-06T21:24:12","date_gmt":"2019-09-06T13:24:12","guid":{"rendered":"http:\/\/diuut.xyz\/?p=584"},"modified":"2019-09-06T21:24:12","modified_gmt":"2019-09-06T13:24:12","slug":"uri%e4%b8%8eurl%e4%b8%8eurn%e7%9a%84%e5%85%b3%e7%b3%bb","status":"publish","type":"post","link":"https:\/\/diuut.com\/?p=584","title":{"rendered":"URI\u4e0eURL\u4e0eURN\u7684\u5173\u7cfb"},"content":{"rendered":"\n<blockquote class=\"wp-block-quote\"><p>URI\uff1a \u7edf\u4e00\u8d44\u6e90\u6807\u8bc6\u7b26\uff08Uniform Resource Identifier) <\/p><\/blockquote>\n\n\n\n<blockquote class=\"wp-block-quote\"><p>URL\uff1a\u7edf\u4e00\u8d44\u6e90\u5b9a\u4f4d\u7b26\uff08 Uniform Resource Locator\uff09<\/p><\/blockquote>\n\n\n\n<p>\u7edf\u4e00\u8d44\u6e90\u5b9a\u4f4d\u7b26\uff08Uniform Resource Locator\uff0cURL\uff09,\u7edf\u4e00\u8d44\u6e90\u540d\u79f0\uff08Uniform Resource Name\uff0cURN\uff09\u662fURI\u7684\u5b50\u96c6\u3002Web\u4e0a\u5730\u5740\u7684\u57fa\u672c\u5f62\u5f0f\u662fURI,\u5b83\u6709\u4e24\u79cd\u5f62\u5f0f\uff1a\u4e00\u79cd\u662fURL\uff0c\u8fd9\u662f\u76ee\u524dURI\u7684\u6700\u666e\u904d\u5f62\u5f0f\u3002\u53e6\u4e00\u79cd\u5c31\u662fURN\uff0c\u8fd9\u662fURL\u7684\u4e00\u79cd\u66f4\u65b0\u5f62\u5f0f\uff0cURN\u4e0d\u4f9d\u8d56\u4e8e\u4f4d\u7f6e\uff0c\u5e76\u4e14\u6709\u53ef\u80fd\u51cf\u5c11\u5931\u6548\u8fde\u63a5\u7684\u4e2a\u6570\u3002\u4f46\u662f\u5176\u6d41\u884c\u8fd8\u9700\u5047\u4ee5\u65f6\u65e5\uff0c\u56e0\u4e3a\u5b83\u9700\u8981\u66f4\u7cbe\u5bc6\u8f6f\u4ef6\u7684\u652f\u6301\u3002 <\/p>\n\n\n\n<p>\u6700\u7ecf\u5e38\u6df7\u6dc6\u7684\u5c31\u662fURL\u4e0eURL\uff0c\u56e0\u4e3a\u8fd9\u4e24\u8005\u662f\u606f\u606f\u76f8\u5173\u7684\uff0c\u5e76\u975e\u6240\u6709URI\u90fd\u662fURL\uff0c\u56e0\u4e3aURI\u53ef\u4ee5\u662f\u540d\u79f0\u3001\u5b9a\u4f4d\u7b26\uff0c\u6216\u8005\u4e8c\u8005\u517c\u6709\u7684\u5728\u7ebf\u8d44\u6e90\uff0c\u800cURL\u53ea\u662f\u5b9a\u4f4d\u5668\u3002URL\u662fURI\u7684\u5b50\u96c6\uff0c\u610f\u5473\u7740\u6240\u6709\u7684URL\u90fd\u662fURI\uff0c\u4f46\u5e76\u4e0d\u662f\u6240\u6709\u7684URL\u662fURI\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img src=\"https:\/\/res.cloudinary.com\/practicaldev\/image\/fetch\/s--lrbx3qNQ--\/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880\/https:\/\/thepracticaldev.s3.amazonaws.com\/i\/j4bka41nypm4do1f3e5b.JPG\" alt=\"difference between a uri and a url\"\/><figcaption>\u56fe\u7247\u6765\u6e90\u4e8e\u53c2\u8003\u8d44\u6599\u7b2c\u4e00\u6761<\/figcaption><\/figure>\n\n\n\n<p>\u5982\u4e0a\u56fe\u6240\u793a\uff0c\u4f60\u7684\u540d\u5b57\u53ef\u4ee5\u662f\u4e00\u4e2aURI\uff0c\u56e0\u4e3a\u5b83\u53ef\u4ee5\u8bc6\u522b\u5230\u4f60\uff0c\u4f46\u5b83\u53ef\u80fd\u4e0d\u662f\u4e00\u4e2aURL\uff0c\u56e0\u4e3a\u5b83\u65e0\u6cd5\u5b9a\u4f4d\u5230\u4f60\uff0c\u4f46\u662f\u4f60\u7684\u5730\u5740\u5c31\u662f\u4e00\u4e2aURL\u53caURI\uff0c\u56e0\u4e3a\u5b83\u53ef\u4e00\u4e2a\u8bc6\u522b\u5230\u4f60\uff0c\u4e5f\u53ef\u4ee5\u5b9a\u4f4d\u5230\u4f60\u3002\u518d\u6bd4\u5982\u4e00\u4e2a\u56fe\u7247\u5730\u5740\uff0c\u6211\u4eec\u5373\u53ef\u4ee5\u4f7f\u7528URI\u4e5f\u53ef\u4ee5\u4f7f\u7528URL\uff0c\u4f46\u662f\u533a\u522b\u5c31\u5728\u4e8e\u4e00\u4e2a\u76f8\u5bf9\u4e00\u4e2a\u7edd\u5bf9\uff0cURL\u7684\u8bdd\u662f\u6ca1\u95ee\u9898\u7684\uff0c\u56e0\u4e3a\u5b83\u65e2\u662fimgURL\u53c8\u662fimgURI\uff0c\u65e0\u8bba\u5f53\u524d\u5730\u5740\uff0c\u90fd\u80fd\u5bfb\u627e\u5230\u8be5\u56fe\u7247\uff0c\u4f46\u662f\u5982\u679c\u7528\u5355\u7eaf\u7684imgURI\u7684\u8bdd\uff0c\u5c31\u6709\u53ef\u80fd\u56e0\u4e3a\u4f4d\u7f6e\u53d8\u52a8\u800c\u627e\u4e0d\u5230\u5bf9\u5e94\u76ee\u5f55\u7684\u56fe\u7247\u8d44\u6e90\uff0c\u5982\u4f55\u9009\u62e9\u5c31\u8981\u89c6\u60c5\u51b5\u800c\u5b9a\u4e86\u3002<\/p>\n\n\n\n<pre class=\"brush: java; title: ; notranslate\" title=\"\">\n\/\/\u4e24\u8005\u8fd4\u56de\u7684\u5185\u5bb9\u6709\u4f55\u4e0d\u540c\uff1f\nSystem.out.println(request.getRequestURI());\nSystem.out.println(request.getRequestURL());\n\/\/\u8fd0\u884c\u8bbf\u95ee\u7ed3\u679c\u5982\u4e0b\uff1a\n'\/travel\/testServlet'\n'http:\/\/localhost\/travel\/testServlet'\n\/\/\u4ee5\u4e0a\u8bbf\u95ee\u7684\u662fServlet\uff0c\u5176\u4ed6\u8d44\u6e90\u540c\u7406\u3002\n<\/pre>\n\n\n\n<blockquote class=\"wp-block-quote\"><p>URN\uff1a\u7edf\u4e00\u8d44\u6e90\u540d\u79f0 (Uniform Resource Name) <\/p><\/blockquote>\n\n\n\n<p>URN\u5728web\u4e2d\u4e3b\u8981\u5e94\u7528\u662f\u4e0b\u62c9\u83dc\u5355\u7684\u5236\u4f5c\u3002\u4f7f\u7528URN\u65f6\u4e0b\u62c9\u83dc\u5355\u7684\u6613\u6269\u5c55\u6027\u5c06\u4f1a\u5f97\u5230\u5f88\u5927\u7684\u63d0\u9ad8\u3002<br>P2P\u4e0b\u8f7d\u4e2d\u4f7f\u7528\u7684\u78c1\u529b\u94fe\u63a5\u662fURN\u7684\u4e00\u79cd\u5b9e\u73b0\uff0c\u5b83\u53ef\u4ee5\u6301\u4e45\u5316\u7684\u6807\u8bc6\u4e00\u4e2aBT\u8d44\u6e90\uff0c\u8d44\u6e90\u5206\u5e03\u5f0f\u7684\u5b58\u50a8\u5728P2P\u7f51\u7edc\u4e2d\uff0c\u65e0\u9700\u4e2d\u5fc3\u670d\u52a1\u5668\u7528\u6237\u5373\u53ef\u627e\u5230\u5e76\u4e0b\u8f7d\u5b83\u3002  <\/p>\n\n\n\n<ul><li>\u53c2\u8003\u8d44\u6599\uff1a<\/li><li> https:\/\/dev.to\/flippedcoding\/what-is-the-difference-between-a-uri-and-a-url-4455<\/li><li> https:\/\/blog.csdn.net\/lp_cq242\/article\/details\/80504612 <\/li><li> https:\/\/baike.baidu.com\/item\/URI<\/li><li> https:\/\/baike.baidu.com\/item\/URL<\/li><li> https:\/\/baike.baidu.com\/item\/URN <\/li><\/ul>\n","protected":false},"excerpt":{"rendered":"<p>URI\uff1a \u7edf\u4e00\u8d44\u6e90\u6807\u8bc6\u7b26\uff08Uniform Resource Identifier) URL\uff1a\u7edf\u4e00\u8d44\u6e90\u5b9a\u4f4d\u7b26\uff08 <span class=\"more-button\"><a href=\"https:\/\/diuut.com\/?p=584\" class=\"more-link\">view all . . .<span class=\"screen-reader-text\">URI\u4e0eURL\u4e0eURN\u7684\u5173\u7cfb<\/span><\/a><\/span><\/p>\n","protected":false},"author":1,"featured_media":592,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[2],"tags":[],"_links":{"self":[{"href":"https:\/\/diuut.com\/index.php?rest_route=\/wp\/v2\/posts\/584"}],"collection":[{"href":"https:\/\/diuut.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/diuut.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/diuut.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/diuut.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=584"}],"version-history":[{"count":0,"href":"https:\/\/diuut.com\/index.php?rest_route=\/wp\/v2\/posts\/584\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/diuut.com\/index.php?rest_route=\/wp\/v2\/media\/592"}],"wp:attachment":[{"href":"https:\/\/diuut.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=584"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/diuut.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=584"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/diuut.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=584"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}