RCurl과 함께 작동하도록 다음 HTTP GET 명령을 번역하고 싶습니다.
curl -G https://api.example.com/resource \
-d "param=value" \
-d "param=value" \
-u 'user:password'
RCurl에서 getURL을 사용하는 시도는 다음과 같습니다.
getURL("https://api.example.com/resource",
userpwd ="username:password",param="value",param="value")
첫 번째 코드 블록은 명령 줄 터미널에서 잘 작동하며 매개 변수를 설정하려고 할 때까지 getURL을 사용하는 데 문제가 없습니다. 매개 변수가 "Unrecognized CURL options"라는 경고 메시지가 표시됩니다. 어떤 아이디어?
...
인수로 가는 모든 것은 curl 옵션으로 해석됩니다. httpheader
인수 에 매개 변수를 목록으로 넣어야합니다 . 설명서를 참조하십시오 .
다음과 같이 시도하십시오.
getURL("https://api.example.com/resource",
userpwd ="username:password",
httpheader=list(param1="value",param2="value"))
이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.
침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제
몇 마디 만하겠습니다