net/httpã使ç¨ãã¦ãã·ã³ãã«ãªPOSTãããã¡ã¤ã«ã®ã¢ãããã¼ãã¾ã§è©¦ãã¦ã¿ã¾ããã ã¾ãã¯ã·ã³ãã«ãªãã¿ã¼ã³ã require "net/http" require "uri" uri = URI.parse("http://www.mysample.com/index.php") Net::HTTP.start(uri.host, uri.port){|http| #ãããã¼é¨ header = { "user-agent" => "Ruby/#{RUBY_VERSION} MyHttpClient" } #ããã£é¨ body = "id=1&name=name" #éä¿¡ response = http.post(uri.path, body, header) } 次ã«ãHTTPRequestã®ãµãã¯ã©ã¹ã§ããNet::HTTP::Postã使ç¨ãããã¿ã¼ã³ã require
{{#tags}}- {{label}}
{{/tags}}