Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setting a custom user_agent? #97

Closed
Ironholds opened this issue Apr 20, 2014 · 7 comments
Closed

Setting a custom user_agent? #97

Ironholds opened this issue Apr 20, 2014 · 7 comments

Comments

@Ironholds
Copy link
Contributor

Probably me being exceedingly dim and/or not understanding something obvious, but I can't for the life of me work out how to set a custom user agent (or if it's even possible the fact that user_agent is exported suggests it should be).

GET(url = "http://httpbin.org/user-agent", config = list(useragent = "turnip"))
Response [http://httpbin.org/user-agent]
  Status: 200
  Content-type: application/json
{
  "user-agent": "curl/7.32.0 Rcurl/1.95.4.1 httr/0.3"
} 

GET(url = "http://httpbin.org/user-agent", user_agent = "turnip"))
Response [http://httpbin.org/user-agent]
  Status: 200
  Content-type: application/json
{
  "user-agent": "curl/7.32.0 Rcurl/1.95.4.1 httr/0.3"
}
@hadley hadley closed this as completed in 4c9129e Apr 21, 2014
@hadley
Copy link
Member

hadley commented Apr 21, 2014

FYI the canonical way to set the user agent is GET("http://httpbin.org/user-agent", user_agent("turnip"))

@Ironholds
Copy link
Contributor Author

Yeah, I tried that. No dice.

@hadley
Copy link
Member

hadley commented Apr 21, 2014

It should work now.

@Ironholds
Copy link
Contributor Author

Thanks!

@jankowtf
Copy link

jankowtf commented May 8, 2014

Could it be that the issue still prevails under cetain circumstances (e.g. running on Windows, depending on RCurl version etc.)?

Tried it today and got the same behavior as @Ironholds: stackoverflow

@hadley
Copy link
Member

hadley commented May 9, 2014

@Rappster could you please file a minimal reproducible example as a new issue?

@jankowtf
Copy link

Sure, I will do that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants