我使用命令行工具捲曲發佈的數據,並從服務器的響應,該命令是這樣的:基於R完整-X POST命令行工具捲曲
curl -X POST -H 'Content-Type: application/gpx+xml' -H 'Accept: application/json' --data-binary @gpslog.gpx "http://test.roadmatching.com/rest/mapmatch/?app_id=MY_APPID&app_key=MY_APPKEY" -o output.json
我使用RCurl包做嘗試同樣的事情,但它不起作用。有人能指引我走向正確的方向嗎?謝謝。
postForm(uri = "http://test.roadmatching.com/rest/mapmatch/?app_id=MYID&app_key=MYKEY",
.ops = list(httpheader = c('Content-type': 'application/gpx','Accept': 'application/json')),
.params = "/Users/data.gpx")
你可能想從這篇文章中刪除實際的ID和密鑰。 – DunderChief
@DunderChief,謝謝。 –