ãµã¨æ°ã«ãªã£ã¦ Location: ãããã« data: ã¹ãã¼ã ãæå®ããå ´åãã©ã¦ã¶ãã©ãããæåã示ãã®ã試ãã¦ã¿ãã æ £ãã¦ããã®ã§ WEBrick ã§ã require 'webrick' require 'uri' s = WEBrick::HTTPServer.new(:Port => 8080) class MyServlet < WEBrick::HTTPServlet::AbstractServlet def do_GET(req, res) res.status = 302; res['Location'] = 'data:text/html,' + URI.escape(%{<html><body><s>oops</s></body></html>}) res.body = 'Okie-dokie!' end end s.mount("/", MyServlet)
{{#tags}}- {{label}}
{{/tags}}