单选题 在Express框架中,下列哪个方法用于发送HTTP响应?

A、 res.send()
B、 res.end()
C、 res.json()
D、 res.render()
下载APP答题
由4l***mh提供 分享 举报 纠错

相关试题

单选题 Express框架中,用于处理表单数据的方法是?

A、app.bodyParser()
B、app.urlencoded()
C、app.use(bodyParser.urlencoded())
D、app.use(urlencoded())

单选题 Express框架中,用于设置静态文件服务的方法是?

A、app.static()
B、app.serveStatic()
C、app.use(express.static())
D、app.setStatic()

单选题 在Express框架中,用于定义GET请求路由的方法是?

A、app.route()
B、app.get()
C、app.post()
D、app.use()

单选题 在Express框架中,用于处理HTTP GET请求的方法是?

A、app.get()
B、app.post()
C、app.delete()
D、app.put()

单选题 在Express框架中,哪个中间件用于处理POST请求的数据?

A、body-parser
B、cookie-parser
C、morgan
D、helmet

单选题 在Express中,如何设置响应头信息?

A、res.setHeader('Content-Type', 'text/html')
B、res.header('Content-Type', 'text/html')
C、res.setHeaders('Content-Type', 'text/html')
D、res.headers('Content-Type', 'text/html')

单选题 在Express框架中,用于处理HTTP DELETE请求的方法是?

A、app.get()
B、app.post()
C、app.delete()
D、app.put()

单选题 在Express中,如何设置全局错误处理中间件?

A、app.error((err, req, res, next) => {...})
B、app.use((err, req, res, next) => {...})
C、app.errorHandler((err, req, res, next) => {...})
D、app.onError((err, req, res, next) => {...})