fromJSON postForm error with Proxy set
Opened this issue · 1 comments
GoogleCodeExporter commented
What steps will reproduce the problem?
1. Sys.setenv(http_proxy="http://PROXY.com:80")
2. Run Post to get Access Token
3.
What is the expected output? What do you see instead?
I expect to get an access token back.
Instead I get:
Error in fromJSON(postForm("https://accounts.google.com/o/oauth2/token", :
STRING_ELT() can only be applied to a 'character vector', not a 'raw'
What version of the product are you using? On what operating system?
1.4
Please provide any additional information below.
R-3.0.2
Original issue reported on code.google.com by dreyco...@gmail.com
on 21 Mar 2014 at 6:32
GoogleCodeExporter commented
issue resolved by changing from:
rt = fromJSON(postForm('https://accounts.google.com/o/oauth2/token',
refresh_token = refreshtoken,
client_id = client_id,
client_secret = client_secret,
grant_type = "refresh_token",
style = "POST" ))
# accesstoken$access_token = rt$access_token
access_token = rt$access_token
To (resolved by adding rawToChar()):
rt = fromJSON(rawToChar(postForm('https://accounts.google.com/o/oauth2/token',
refresh_token = refreshtoken,
client_id = client_id,
client_secret = client_secret,
grant_type = "refresh_token",
style = "POST" )))
# accesstoken$access_token = rt$access_token
access_token = rt$access_token
Original comment by dreyco...@gmail.com
on 21 Mar 2014 at 6:51