ruby - Using Curl to download files that require logging in -


i need download movie files website requires logging in. started prototyping script using mechanize, i'm wondering if curl supports sending username , password server, make work lot faster.

i use httparty rather curl. supports authentication.(http://httparty.rubyforge.org)

sudo gem install httparty

here example shows authentication taken site.

class twitter   include httparty   base_uri 'twitter.com'   basic_auth 'username', 'password' end  twitter.post('/statuses/update.json', :query => {:status => "it's httparty , invited!"}) 

Comments

Popular posts from this blog

c++ - Convert big endian to little endian when reading from a binary file -

C#: Application without a window or taskbar item (background app) that can still use Console.WriteLine() -

unicode - Are email addresses allowed to contain non-alphanumeric characters? -