Home Can a rails application identify when a request is from curl?
Reply: 1

Can a rails application identify when a request is from curl?

MicFin
1#
MicFin Published in 2017-11-10 03:38:45Z

A rails application can use the request object to access user agent and more data about the request. How to detect browser type and its version

But with curl, a developer can set the header data and more. How to use curl to get a GET request exactly same as using Chrome?

Can a rails application accurately detect when a request is sent by a software like curl versus a browser?

John Ellmore
2#
John Ellmore Reply to 2017-11-10 03:44:47Z

No. cURL can simulate any HTTP request with the correct configuration. There is no way to tell the difference between Chrome and cURL from an HTTP request alone.

If you're trying to make it harder to scrape data from your server, you'll want to use other methods (rate-limiting, authentication, etc.). But there is no perfect solution to prevent a determined scraper.

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.308784 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO