如何在Ruby中运行此curl命令?

时间:2016-02-11 23:37:24

标签: ruby curl

{{1}}

Net :: HTTP中是否有一个允许propfind命令的特定方法?

1 个答案:

答案 0 :(得分:0)

Net::HTTP::Propfind

以下是一个例子:

uri = URI.parse('http://example.com')
http = Net::HTTP.new(uri.host, uri.port)
request = Net::HTTP::Propfind.new(uri.request_uri)

# Set your body (data)
request.body = "Here's the body."

# Set your headers: one header per line.
request["Content-Type"] = "application/json"

response = http.request(request)