title: How do I use Curb? Getting unsupported protocol error?
body: <p>I am having an issue performing a simple HTTP GET request using <a href="https://github.com/taf2/curb" rel="nofollow">curb</a>.</p>
  
  <p>The code is:</p>
  
  <pre><code>def getHtml ()
    raw = Curl::Easy.perform(@url)
    puts raw.body_str
  end
  </code></pre>
  
  <p>The error message I get when I try to run it is:</p>
  
  <pre><code>Curl::Err::UnsupportedProtocolError (Curl::Err::UnsupportedProtocolError)
     from /home/&lt;Username&gt;/.gem/ruby/2.1.0/gems/curb-0.8.5/lib/curl/easy.rb:317:in `perform'
     from getCorpusData.rb:6:in `getHtml'
     from getCorpusData.rb:11:in `&lt;main&gt;'
  </code></pre>
  
  <p>The request used is:</p>
  
  <pre><code>'http://corpus2.byu.edu/glowbe/x2.asp?chooser=seq&amp;p=%5B%3Dbat%5D&amp;w2=&amp;wl=4&amp;wr=4&amp;r1=&amp;r2=&amp;ipos1=-select-&amp;B7=SEARCH&amp;showsec=y&amp;sec1=0&amp;sec2=0&amp;sortBy=freq&amp;sortByDo2=freq&amp;minfreq1=freq&amp;freq1=20&amp;freq2=20&amp;numhits=100&amp;kh=100&amp;groupBy=words&amp;whatshow=raw&amp;saveList=no&amp;changed=&amp;corpus=glowbe&amp;word=&amp;sbs=&amp;sbs1=&amp;sbsreg1=&amp;sbsr=&amp;sbsgroup=&amp;redidID=&amp;ownsearch=y&amp;compared=&amp;holder=&amp;whatdo=seq&amp;rand1=y&amp;whatdo1=1&amp;didRandom=n&amp;minFreq=freq&amp;s1=0&amp;s2=0&amp;s3=0&amp;perc=mi' -H 'Accept-Encoding: gzip,deflate,sdch' -H 'Accept-Language: en-US,en;q=0.8,es;q=0.6' -H 'User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/32.0.1700.102 Safari/537.36' -H 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8' -H 'Referer: http://corpus2.byu.edu/glowbe/x1.asp?a=&amp;user=&amp;word=&amp;k=&amp;h=&amp;q1=&amp;q=&amp;c=glowbe' -H 'Cookie: ASPSESSIONIDSQCCCACB=KKPJLDIDNPDBDHCBLFDKBKLE; ASPSESSIONIDSQDAADDB=KCGNJBIAONDCMKCLGNNHEEFM; __utma=93336079.428180068.1390938982.1390938982.1391007383.2; __utmb=93336079.1.10.1391007383; __utmc=93336079; __utmz=93336079.1391007383.2.2.utmcsr=corpus.byu.edu|utmccn=(referral)|utmcmd=referral|utmcct=/; ii=4' -H 'Connection: keep-alive'
  </code></pre>
  
  <p>It works on  examples such as www.google.co.uk:</p>
  
  <pre><code>* Protocol 'http not supported or disabled in libcurl
  * Closing connection -1
  /home/&lt;username&gt;/.gem/ruby/2.1.0/gems/curb-0.8.5/lib/curl/easy.rb:62:in `perform':    Curl::Err::UnsupportedProtocolError (Curl::Err::UnsupportedProtocolError)
  from /home/&lt;username&gt;/.gem/ruby/2.1.0/gems/curb-0.8.5/lib/curl/easy.rb:317:in `perform'
  from getCorpusData.rb:7:in `getHtml'
  from getCorpusData.rb:16:in `&lt;main&gt;'
  </code></pre>
  
  <p>My current method is:</p>
  
  <pre><code>def getHtml ()
    corpus = Curl::Easy.perform(@url) do |curl|
       curl.headers["User-Agent"] = "GibSim-0.0"
       curl.verbose = true
    end
    corpus.perform
    puts corpus.body_str + "&lt;_____HERE"
  end
  </code></pre>
  
  <p>and the current URL is:</p>
  
  <pre><code> 'http://corpus2.byu.edu/glowbe/x2.asp?chooser=seq&amp;p=%5B%3Dbat%5D&amp;w2=&amp;wl=4&amp;wr=4&amp;r1=&amp;r2=&amp;ipos1=-select-&amp;B7=SEARCH&amp;showsec=y&amp;sec1=0&amp;sec2=0&amp;sortBy=freq&amp;sortByDo2=freq&amp;minfreq1=freq&amp;freq1=20&amp;freq2=20&amp;numhits=100&amp;kh=100&amp;groupBy=words&amp;whatshow=raw&amp;saveList=no&amp;changed=&amp;corpus=glowbe&amp;word=&amp;sbs=&amp;sbs1=&amp;sbsreg1=&amp;sbsr=&amp;sbsgroup=&amp;redidID=&amp;ownsearch=y&amp;compared=&amp;holder=&amp;whatdo=seq&amp;rand1=y&amp;whatdo1=1&amp;didRandom=n&amp;minFreq=freq&amp;s1=0&amp;s2=0&amp;s3=0&amp;perc=mi' -H 'Accept-Encoding: gzip,deflate,sdch' -H 'Accept-Language: en-US,en;q=0.8,es;q=0.6'
  </code></pre>
  
  <p>I'm still not really sure what to make of it!</p>