HTTPClient 从字符串发布
我正在尝试集成 Zoho 查看器:
clnt = HTTPClient.new
@zoho_link = clnt.post('http://viewer.zoho.com/api/view.do', {:apikey => 'd4a361ce621000000000000', :file => File.new('/home/jon/Desktop/data.csv')})
我的变量中已经有数据,并且我想将其作为多部分后参数传递。如何在不创建 data.csv 文件的情况下完成这项工作?
谢谢!
I'm trying to integrate Zoho viewer:
clnt = HTTPClient.new
@zoho_link = clnt.post('http://viewer.zoho.com/api/view.do', {:apikey => 'd4a361ce621000000000000', :file => File.new('/home/jon/Desktop/data.csv')})
I already have data in a variable and I want to pass it as a multipart post parameter. How can I make this work without creating a data.csv file?
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如此使用 StringIO :
Use StringIO thusly: