所以,我終於得到我的ping命令使用HTTR如下面的腳本捲曲HTTR的玫瑰花API無效的方法
library(httr)
curl_com = GET("https://api.rosette.com/rest/v1/ping", add_headers(`X-RosetteAPI-Key` = "my api"))
偉大的東西的工作,但現在COS林在下一位stucked。
現在我想調用另一個API做情感分析
curl -X POST \
-H "X-RosetteAPI-Key: your_api_key" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "Cache-Control: no-cache" \
-d '{"content": "Original Ghostbuster Dan Aykroyd, who also co-wrote the 1984 Ghostbusters film, couldn’t be more pleased with the new all-female Ghostbusters cast, telling The Hollywood Reporter, 「The Aykroyd family is delighted by this inheritance of the Ghostbusters torch by these most magnificent women in comedy.」" }' \
"https://api.rosette.com/rest/v1/sentiment"
我得到錯誤405 - 不允許的方法 - 你試圖用一個無效的方法來訪問玫瑰花API。我不知道如何使用httr來翻譯上面的curl命令有人可以通過一步一步來談談我嗎?
希望有人能幫助取悅 佩迪
您知道Rosette爲其API提供了[R package](https://github.com/rosette-api/R-Binding),對不對? – hrbrmstr