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

ruby - When to use an ORM (Sequel, Datamapper, AR, etc.) vs. pure SQL for querying -

php - PHPDoc: @return void necessary? -

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