我需要知道如何用RCurl编写这个参数:
curl -v -X PUT -H "X-IBM-Client-Secret:YOUR_CLIENT_SECRET" -H "X-IBM-Client-Id:YOUR_CLIENT_ID" -H "Content-Type: application/json" -d '{"clientName": "The Sample Outdoors Company", "redirectURIs": "https://example.com:5443", "ownerName": "John Smith", "ownerEmail": "John.Smith@example.com", "ownerCompany": "example.com", "ownerPhone": "555-123-4567"}' https://api.ibm.com/watsonanalytics/run/oauth2/v1/config
我非常感谢你的帮助。
答案 0 :(得分:0)
你可以像这样使用它:
library(RCurl)
library(RJSONIO)
httpPUT("https://api.ibm.com/watsonanalytics/run/oauth2/v1/config",
content = toJSON(list('clientName' = "The Sample Outdoors Company", 'redirectURIs' = "https://example.com:5443", "ownerName" = "John Smith", "ownerEmail" = "John.Smith@example.com", "ownerCompany" = "example.com", "ownerPhone" = "555-123-4567")),
.opts = list(httpheader = c('Content-Type' = 'application/json', 'X-IBM-Client-Secret' = 'YOUR_CLIENT_SECRET', 'X-IBM-Client-Id' = 'YOUR_CLIENT_ID')))
而不是toJSON
,你只能传递一个字符串。