Chef infra 具有Chef http_请求资源的多部分POST
有没有一种方法可以使用Chef http_请求资源进行多部分post?我有如下类似的东西发布文件内容,但我需要随附表单数据Chef infra 具有Chef http_请求资源的多部分POST,chef-infra,multipartform-data,chef-recipe,Chef Infra,Multipartform Data,Chef Recipe,有没有一种方法可以使用Chef http_请求资源进行多部分post?我有如下类似的东西发布文件内容,但我需要随附表单数据 http_request 'post_file_and_form_data' do headers ({'Content-Type' => 'multipart/form-data'}) url "http://myhost:2000/myapp/upload" action :post message lazy { ::File.read("/som
http_request 'post_file_and_form_data' do
headers ({'Content-Type' => 'multipart/form-data'})
url "http://myhost:2000/myapp/upload"
action :post
message lazy { ::File.read("/somewhere/myFile.yaml") }
end
我不确定底层Ruby标准库(
Net::HTTP
)是否支持这一点。我已经看到大多数需要这样做的实现最终都使用了。我建议在你的食谱中安装并使用它,也许是在Ruby块中。我不确定底层Ruby标准库(Net::HTTP
)是否支持这一点。我已经看到大多数需要这样做的实现最终都使用了。我建议安装它并在你的食谱中使用,也许是在Ruby块中