require 'net/http'
require 'uri'
@url = 'http://foobar.com'
@query_string = {foo1: 'bar1', foo2: 'bar2'}
@post_data = Net::HTTP.post_form(URI.parse(@url), @query_string)
@request = # ? How can I get the request URL + query?
@response = @post_data.body
有谁知道如何获取您查询的实际 URL,而不仅仅是响应?
即我想将其存储在一个变量中以记录发送的内容: