<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>

                ??碼云GVP開源項目 12k star Uniapp+ElementUI 功能強大 支持多語言、二開方便! 廣告
                # 響應 響應對象可以向客戶端發送響應,并終止請求。若沒有從路由處理函數調用這些方法,則客戶端請求將保持掛起狀態。其有以下這些方法: * res.status() Set status code. * res.type() Set MIME type. * **res.send()** Send a response of various types. * **res.json()** Send a JSON response. * **res.render()** Render a view template. * res.sendStatus() Set the response status code and send its string representation as the response body. * res.sendFile() Send a file as an octet stream. * res.end() End the response process. * res.redirect() Redirect a request. * res.download() Prompt a file to be downloaded. * res.jsonp() Send a JSON response with JSONP support. ``` // 響應 JSON 格式數據 const express = require('express'); const app = express(); app.get('/', (req, res) => { let jsonData = {name : 'xx', age : 11}; // 把上面的 JS 對象自動轉 JSON , 并設置響應頭Content-Type的值為application/json;chasert=utf-8 res.json(jsonData); }); app.listen(8888, () => { console.log('Example app listening on port 8888!'); }); ``` ``` // 文件下載 // 文件位置 myapp/a.txt const path = require('path'); const express = require('express'); const app = express(); app.get('/', (req, res) => { res.download(path.join(__dirname, 'a.txt')); }); app.listen(8888, () => { console.log('Example app listening on port 8888!'); }); ```
                  <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>

                              哎呀哎呀视频在线观看