Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
A simple wrapper for curl http://curl.haxx.se/
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
lib
test/units
.gitignore
.rvmrc
CHANGELOG.md
Gemfile
Gemfile.lock
MIT-LICENSE
README.md
Rakefile
curl_wrapper.gemspec

README.md

curl_wrapper as the name says is a wraper for the curl command.

install

  gem install curl_wrapper

use

  curl = CurlWrapper.new do |config|
    config.url 'rubygems.org'
  end
  puts curl.body
  curl = CurlWrapper.new do |config|
    config.ntlm
    config.user 'username/password'
    config.request 'POST'
    config.verbose
    config.url 'http://hard_to_automate.sharepoint.com/resource'
  end

  curl.run
  puts curl.error

CurlWrapper is chanable

  puts CurlWrapper.new.url('rubygems.org').run.body
  curl = CurlWrapper.new do |config|
    config.ntlm
    config.user 'username/password'
    config.request 'POST'
  end

  curl.verbose.url 'http://hard_to_automate.sharepoint.com/resource'

  puts curl.run.error

CurlWrapper is autoruns when you need the output

  puts CurlWrapper.new.url('rubygems.org').body
  curl = CurlWrapper.new do |config|
    config.ntlm
    config.user 'username/password'
    config.request 'POST'
  end

  curl.verbose.url 'http://hard_to_automate.sharepoint.com/resource'

  puts curl.error

CurlWrapper just works so you can have fun exploring HTTP

lets just skip new and body and stil get what we want

  puts CurlWrapper.url('rubygems.org')
  curl = CurlWrapper do |config|
    config.ntlm
    config.user 'username/password'
    config.request 'POST'
  end.verbose.url( 'http://hard_to_automate.sharepoint.com/resource' )

  puts curl
Something went wrong with that request. Please try again.