在另一台服务器上使用 chef http_request 方法发布测试文件



我想使用 chef http_request 方法在服务器上发布文本文件。 在这里我写了一些东西,但它不起作用-

http_request "post a file" do
  action :post
  url "http://<server_ip>/php/upload.php"
  headers "Content-Type" => "text/plain"
  message ::File.read("#{filename}")
end

谁能建议我怎么做?

文件上传,听起来像是你正在尝试做的,需要比http_request实现更复杂的HTTP机制。您必须自己使用ruby_block和类似法拉第或Chef::HTTP的东西来做。

最新更新