Java EE 企业应用系统开发 - HTTP 响应处理编程
响应对象 响应对象功能和方法 HTTP 响应的内容 在 Web 服务器接收请求处理后,向客户端发送 HTTP 响应 (Response)。 O 响应的内容 ▶ 响应状态(Status Code) ▶ 响应头(Response Header) ▶ 响应体(Response Body) 大纲 HTTP 响应的内容 HTTP 响应对象 响应对象功能和方法 HTTP 响应状态行 表明响应的状态信息,如成功、失败、错误。 向客户端发送指定的错误信息码,可以是任意定义的整数。 1 response.setCharacterEncoding("GBK"); 2 response.sendError(580); O public void sendError(int sc, String msg) throws IOException 向客户端发送指定的错误信息码和自定义状态消息。 1 response.setCharacterEncoding("GBK"); setCharacterEncoding("GBK"); 2 response.sendError(580, "自定义错误"); 大纲 HTTP 响应的内容 HTTP 响应对象 响应对象功能和方法 设置响应头 当客户端接收到响应状态为 200 时,浏览器会继续接收响应头信 息,来确定响应体的类型和大小。 O public void setHeader(String name, String value) 将指定名称和值的响应头发送到客户端。0 码力 | 26 页 | 575.28 KB | 1 年前3Node.js Manual & Documentation
ServerResponse o response.writeContinue() o response.writeHead(statusCode, [reasonPhrase], [headers]) o response.statusCode o response.setHeader(name, value) o response.getHeader(name) o response.removeHeader(name) removeHeader(name) o response.write(chunk, encoding='utf8') o response.addTrailers(headers) o response.end([data], [encoding]) http.request(options, callback) http.get(options, callback) o agent.maxSockets o agent.sockets o agent.queue http.ClientRequest o Event 'response' 事件:'response' o request.write(chunk, encoding='utf8') o request.end([data], [encoding]) o request0 码力 | 153 页 | 1.21 MB | 1 年前3NodeJS 中文文档 V0.2.3
http = require('http'); http.createServer(function (request, response) { response.writeHead(200, {'Content-Type': 'text/plain'}); response.end('Hello World\n'); }).listen(8124); console.log('Server running Event: Event: 'request' 'request' 'request' 'request' function (request, response) { } request 是 http.ServerRequest 的一个实例,而 response 则是 http.ServerResponse 的一个实例 Event: Event: Event: Event: 'connection' 当服务器关闭的时候触发此事件。 Event: Event: Event: Event: 'request' 'request' 'request' 'request' function (request, response) {} 每个请求发生的时候均会被触发。请记住,每个连接可能会有多个请求(在 keep-alive 连接情况下) Event: Event: Event: Event: 'upgrade'0 码力 | 62 页 | 542.14 KB | 1 年前3httpd 2.4.25 中文文档
for the proxy's clients. mod_sed An advanced replacement of mod_substitute, allows to edit the response body with the full power of sed. mod_auth_form Enables form-based authentication. mod_session processing. mod_buffer Provides for buffering the input and output filter stacks mod_data Convert response body into an RFC2397 data URL mod_ratelimit Provides Bandwidth Rate Limiting for Clients mod_request and make available HTTP request bodies mod_reflector Provides Reflection of a request body as a response via the output filter stack. mod_slotmem_shm Provides a Slot-based shared memory provider (ala0 码力 | 2573 页 | 2.12 MB | 1 年前3httpd 2.4.23 中文文档
for the proxy's clients. mod_sed An advanced replacement of mod_substitute, allows to edit the response body with the full power of sed. mod_auth_form Enables form-based authentication. mod_session processing. mod_buffer Provides for buffering the input and output filter stacks mod_data Convert response body into an RFC2397 data URL mod_ratelimit Provides Bandwidth Rate Limiting for Clients mod_request and make available HTTP request bodies mod_reflector Provides Reflection of a request body as a response via the output filter stack. mod_slotmem_shm Provides a Slot-based shared memory provider (ala0 码力 | 2559 页 | 2.11 MB | 1 年前3httpd 2.4.20 中文文档
for the proxy's clients. mod_sed An advanced replacement of mod_substitute, allows to edit the response body with the full power of sed. mod_auth_form Enables form-based authentication. mod_session processing. mod_buffer Provides for buffering the input and output filter stacks mod_data Convert response body into an RFC2397 data URL mod_ratelimit Provides Bandwidth Rate Limiting for Clients mod_request and make available HTTP request bodies mod_reflector Provides Reflection of a request body as a response via the output filter stack. mod_slotmem_shm Provides a Slot-based shared memory provider (ala0 码力 | 2533 页 | 2.09 MB | 1 年前3httpd 2.4.28 中文文档
for the proxy's clients. mod_sed An advanced replacement of mod_substitute, allows to edit the response body with the full power of sed. mod_auth_form Enables form-based authentication. mod_session processing. mod_buffer Provides for buffering the input and output filter stacks mod_data Convert response body into an RFC2397 data URL mod_ratelimit Provides Bandwidth Rate Limiting for Clients mod_request and make available HTTP request bodies mod_reflector Provides Reflection of a request body as a response via the output filter stack. mod_slotmem_shm Provides a Slot-based shared memory provider (ala0 码力 | 2659 页 | 3.10 MB | 1 年前3httpd 2.4.33 中文文档
for the proxy's clients. mod_sed An advanced replacement of mod_substitute, allows to edit the response body with the full power of sed. mod_auth_form Enables form-based authentication. mod_session processing. mod_buffer Provides for buffering the input and output filter stacks mod_data Convert response body into an RFC2397 data URL mod_ratelimit Provides Bandwidth Rate Limiting for Clients mod_request and make available HTTP request bodies mod_reflector Provides Reflection of a request body as a response via the output filter stack. mod_slotmem_shm Provides a Slot-based shared memory provider (ala0 码力 | 2692 页 | 3.12 MB | 1 年前3跟我学Shiro - 张开涛
ServletResponse response) throws Exception void postHandle(ServletRequest request, ServletResponse response) throws Exception void afterCompletion(ServletRequest request, ServletResponse response, Exception onPreHandle(ServletRequest request, ServletResponse response, Object mappedValue) throws Exception abstract boolean isAccessAllowed(ServletRequest request, ServletResponse response, Object mappedValue) throws Exception; quest request, ServletResponse response, Object mappedValue) throws Exception; abstract boolean onAccessDenied(ServletRequest request, ServletResponse response) throws Exception; 跟我学 Shir0 码力 | 219 页 | 4.16 MB | 10 月前3httpd 2.4.18 中文文档
for the proxy's clients. mod_sed An advanced replacement of mod_substitute, allows to edit the response body with the full power of sed. mod_auth_form Enables form-based authentication. mod_session processing. mod_buffer Provides for buffering the input and output filter stacks mod_data Convert response body into an RFC2397 data URL mod_ratelimit Provides Bandwidth Rate Limiting for Clients mod_request and make available HTTP request bodies mod_reflector Provides Reflection of a request body as a response via the output filter stack. mod_slotmem_shm Provides a Slot-based shared memory provider (ala0 码力 | 2467 页 | 1.89 MB | 1 年前3
共 312 条
- 1
- 2
- 3
- 4
- 5
- 6
- 32