<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                ThinkChat2.0新版上線,更智能更精彩,支持會話、畫圖、視頻、閱讀、搜索等,送10W Token,即刻開啟你的AI之旅 廣告
                ### 穩定度: 2 - 穩定 這個模塊提供了URL解析和解釋的工具。通過`require('url')`使用它。 解釋URL為一個含有以下部分或全部屬性的對象,依賴于它們是否在URL字符串中存在。任何不存在的部分都不會出現在解釋后的對象中。一個下面URL的例子: `'http://user:pass@host.com:8080/p/a/t/h?query=string#hash'` - href: 最初傳遞的全部URL。協議和主機都是小寫的。 例子: `'http://user:pass@host.com:8080/p/a/t/h?query=string#hash'` - protocol: 請求的協議,小寫。 例子: `'http:'` - slashes: 協議要求冒號后有斜杠。 例子: `true` 或 `false` - host: URL的所有主機部分,包括端口,小寫。 例子: `'host.com:8080'` - auth: URL的認證信息部分。 例子: `'user:pass'` - hostname: 小寫的主機名部分。 例子: `'host.com'` - port: 主機部分的端口號。 例子: `'8080'` - pathname: URL的路徑部分,在主機之后,在查詢之前,包括最前面的斜杠,如果存在的話。不提供解碼。 例子: `'/p/a/t/h'` - search: URL的“查詢字符串”部分,包括前導的問號標志。 例子: `'?query=string'` - path: 路徑和查詢的連接體。不提供解碼。 例子: `'/p/a/t/h?query=string'` - query: 查詢字符串的“參數”部分,或查詢字符串被解釋后的對象。 例子: `'query=string'` 或 `{'query':'string'}` - hash: URL的“碎片”部分,包括英鎊符號。 例子: `'#hash'` 以下是URL模塊提供的方法: #### url.parse(urlStr[, parseQueryString][, slashesDenoteHost]) 接收一個URL字符串,然后返回一個對象。 對第二個參數傳遞`true`,將使用`querystring`模塊來解釋查詢字符串。如果為`true`,那么最后的對象中一定存在`query`屬性,并且`search`屬性將總是一個字符串(可能為空)。如果為`false`,那么`query`屬性將不會被解釋或解碼。默認為`false`。 對第三個參數傳遞`true`,將會把`//foo/bar`解釋為`{ host: 'foo', pathname: '/bar' }`,而不是`{ pathname: '//foo/bar' }`。默認為`false`。 #### url.format(urlObj) 接受一個解釋完畢的URL對象,返回格式化URL字符串。 以下是格式化過程: - `href`將會被忽略。 - `path`將會被忽略。 - **協議無論是否有末尾的冒號,都會被同樣處理。** - http,https,ftp,gopher,file協議的后綴是`://`。 - 所有其他如mailto,xmpp,aim,sftp,foo等協議的后綴是`:`。 - **如果協議要求有 `://` ,`slashes`會被設置為`true`** - 只有之前沒有列出的要求有斜線的協議才需要被設置。如`mongodb://localhost:8000/`。 - `auth`會被使用,如果存在的話。 - 只有當缺少`host`時,才會使用`hostname`。 - 只有當缺少`host`時,才會使用`port`。 - `host`將會替代`hostname`和`port`。 - 無論有沒有前導 / (斜線),`pathname`都會被相同對待。 - 只有在缺少`search`時,才會使用`query`(對象;參閱`querystring`)。 - **`search`將會替代`query`** - 無論有沒有前導 ?(問號),它都會被相同對待。 - 無論有沒有前導 #(英鎊符號),`hash`都會被相同對待。 #### url.resolve(from, to) 接受一個基礎URL,和一個路徑URL,并且帶上錨點像瀏覽器一樣解析他們。例子: ~~~ url.resolve('/one/two/three', 'four') // '/one/two/four' url.resolve('http://example.com/', '/one') // 'http://example.com/one' url.resolve('http://example.com/one', '/two') // 'http://example.com/two' ~~~
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看