Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is curl and what are its uses for rails developers?

Ive seen mentions of curl here and there on rails blogs and ive scanned some posts here on stackoverflow but im still a bit in the dark as to its use especially when it comes to rails development.

Is it useful for testing? Im currently learning the ins and outs of testing and one of the things i need to do is test a before filter that only allows an action to be called if the user came from a certain external site. Is this an occasion where curl would be used?

like image 506
robodisco Avatar asked Feb 28 '23 23:02

robodisco


1 Answers

curl is a command line program which can retrieve urls, it's quite flexible, for example it can use limited regexes to download a range of files.

You might want to use it for testing, by seeing what happens to your application under certain circumstances, if you want to test what happens if your user comes from a certain site then use the -e option on curl.

The man page is online Here

like image 185
gorilla Avatar answered Mar 12 '23 20:03

gorilla