나는이 시도컬 POST의 RCurl에 문 또는 HTTR
curl -X POST -H 'Content-Type: multipart/form-data;boundary=----------------------------4ebf00fbcf09' \
--data-binary @example.txt \
'http://batch.geocoder.cit.api.here.com/6.2/jobs?action=run&[email protected]&maxresults=1&language=es-ES&header=true&indelim=|&outdelim=|&outcols=displayLatitude,displayLongitude,houseNumber,street,district,city,postalCode,county,state,country,matchLevel,relevance&outputCombined=false&app_code=AJKnXv84fjrb0KIHawS0Tg&app_id=DemoAppId01082013GAL'
노키아의 여기 일괄 지오 코딩 서비스에 파일을 게시하려면이 작업 컬 문 ...이 :
library(RCurl)
url <- "http://batch.geocoder.cit.api.here.com/6.2/jobs? action=run&[email protected]&maxresults=1&language=es-ES&header=true&indelim=|&outdelim=|&outcols=displayLatitude,displayLongitude,houseNumber,street,district,city,postalCode,county,state,country,matchLevel,relevance&outputCombined=false&app_code=AJKnXv84fjrb0KIHawS0Tg&app_id=DemoAppId01082013GAL'"
postForm(url, file=fileUpload(filename="example.txt",
contentType="multipart/form-data;boundary=----------------------------4ebf00fbcf09"))
그리고이 이 파일을 사용
library(httr)
a <- POST(url, body=upload_file("example.txt", type="text/plain"),
config=c(add_headers("multipart/form-data;boundary=----------------------------4ebf00fbcf09")))
content(a)
example.txt
등 : https://gist.github.com/corynissen/4f30378f11a5e51ad9ad
R에서이 속성을 수행 할 수있는 방법이 있습니까?
'-v' (자세한 플래그) 및'verbose()'를 사용하여'httr :: POST'를 사용하여 curl을 실행하고 출력을 비교해보십시오. 그러면 요청간에 다른 점을 파악하는 데 도움이됩니다. – hadley
httr에 --data-binary 옵션을 지정해야하는 것처럼 보입니다. 그렇게 할 수있는 방법이 있습니까? – cory
그 옵션이하는 것이 무엇인지 알아 내야합니다. – hadley