如何使用curl进行以下HTTParty调用
$ curl -u andrew.lunny@nitobi.com -F keystore=@android.keystore -F 'data={"title":"Android Key","alias":"release", "key_pw":"90123456","keystore_pw":"78901234"}' https://build.phonegap.com/api/v1/keys/android以下是我目前的情况:
HTTParty.post("https://build.phonegap.com/api/v1/keys/android?auth_token=#{phonegap_token}", query: { keystore: file }, body: { data: {
title: 'Android Key',
alias: '...',
key_pw: '...',
keystore_pw: '...'
} }, format: :plain)file是我从文件所在的云存储中获取的一个Tempfile对象。
我想传递一个文件,它已经上传使用载波和存储使用雾。我必须先从URL中获取它吗?
发布于 2018-03-17 14:52:12
我不确定它是否会起作用,不过你可以试试:
HTTParty.post("https://build.phonegap.com/api/v1/keys/android",
body: {
data: {
title: 'Android Key',
alias: '...',
key_pw: '...',
keystore_pw: '...'
}.to_json,
keystore: File.read(file)
})https://stackoverflow.com/questions/49337726
复制相似问题