zozi / curb-fu Goto Github PK
View Code? Open in Web Editor NEWThis project forked from gdi/curb-fu
Simple, yet powerful wrapper for taf2's curb (libcurl) library
License: Other
This project forked from gdi/curb-fu
Simple, yet powerful wrapper for taf2's curb (libcurl) library
License: Other
== curb-fu - easy-to-use wrapper around curb - the ruby wrapper around libcurl * http://github.com/curb-fu Curb can be found at http://github.com/taf2/curb === License This gem is released under the terms of the Ruby license. See the LICENSE file for details. === Troubleshooting If you are POSTing data and curb seems to be locking up, try posting it with an explicit 'Expect: 100-continue' header. You can set this per-request, e.g. CurbFu.post({:host => 'example.com', :headers => { "Expect" => "100-continue" }}, { "data" => "here" }) or you can configure it as a global header, e.g. CurbFu.global_headers = { "Expect" => "100-continue" } # ... then make your requests as normal however you feel best. === Prerequisites * Ruby (tested on 1.8.7, 1.9.1) * The Curb gem (and its libcurl dependency) * http://github.com/taf2/curb === Installation $ gem install curb-fu --source http://gems.github.com Or, if you ahve the source: $ cd <source-dir> $ rake gem $ gem install pkg/ === Examples Urls can be requested using hashes of options or strings. The GET, POST, PUT, and DELETE methods are supported through their respective methods on CurbFu and CurbFu::Request. ==== String Examples response = CurbFu.get('http://slashdot.org') puts response.body response = CurbFu.post('http://example.com/some/resource', { :color => 'red', :shape => 'sphere' }) puts response.body unless response.success? ==== Hash Examples response = CurbFu.get(:host => 'github.com', :path => '/gdi/curb-fu') puts response.body response = CurbFu.post({:host => 'example.com', :path => '/some/resource'}, { :color => 'red', :shape => 'sphere' }) puts response.body unless response.success? if you need https: response = CurbFu.post({:host => 'example.com', :path => '/some/resource', :protocol => "https"}, { :color => 'red', :shape => 'sphere' }) Have fun!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.