gdi / curb-fu Goto Github PK
View Code? Open in Web Editor NEWSimple, yet powerful wrapper for taf2's curb (libcurl) library
License: Other
Simple, yet powerful wrapper for taf2's curb (libcurl) library
License: Other
when install, got the following message:
Successfully installed curb-fu-0.6.1
1 gem installed
Invalid gemspec in [/usr/local/lib/ruby/gems/1.9.1/specifications/curb-fu-0.6.1.gemspec]: Illformed requirement ["#Syck::DefaultKey:0x000000030094e0 1.3.2"]
Installing ri documentation for curb-fu-0.6.1...
Installing RDoc documentation for curb-fu-0.6.1...
Actually, it is NOT correctly installed, as I cannot require it.
The generated gem for the latest version is completely empy. Verified by both the gem command and by manually downloading the gem, unpacking it and then untaring the data.tar.gz file.
Hello,
I'm seeing a major issue in curb-fu
In file lib/curb-fu/core_ext.rb, it seems that curb-fu is extending the core. In that situation and as it is done here breaks some features of rails using .to_params
Example:
cache [object, something] #in a view
throws: /Users/x/.rvm/gems/ruby-1.8.7-p299/gems/curb-fu-0.4.4/lib/curb-fu/core_ext.rb:45:in `to_param'
This makes the whole gem unusable for me as it is. Also, no offense, but seeing core extensions like that cannot be a good sign...
Cheers
This is what I did based on the documentation:
response = CurbFu.post(:url => url, payload, :headers => {'Content-Type' =>'application/json',
'Authorization' => "Bearer #{token}" })
But it's expecting a hash....
I try to use curb-fu to follow link after post
response = CurbFu.post({:url => 'https://secure.transferuj.pl', :protocol => "https"}, { :imie => 'pat', :nazwisko => 'mas', :id => '1010', :kwota => '1234', :opis => 'marnypopis' }) { |curb| curb.follow_location = true }
and i get Template is missing. Could you help me with this?
I have tried to used curb-fu inside a controller but it just hang but when I tried to put it in a rake task it run just fine. This is the code
response = CurbFu.post(Figaro.env.bpi_url.to_s.strip, bpi_data) { |curb|
curb.follow_location = true ,
curb.enable_cookies = true
}
Any idea why?
Hey, not a huge deal, but this ended up preventing me from utilizing
built_url = "http://#{url_params[:host]}"
If you were to change to something like
protocol = url_params[:protocol] ||= "http"
built_url = "#{protocol}://#{url_params[:host]}"
I still get the same error using the following:
response = CurbFu.post({ :url => url, :headers => { 'Content-Type' => 'application/json', 'Authorization' => "Bearer #{token}" } }, payload)
HTTP Status 400 - Bad Request
But curl works:
curl "https://api-sandbox.billforward.net:443/v1/subscriptions/SUB-35F07614-4F6D-4AF2-95EB-F3DB03FE/advance" \
-H "Authorization: Bearer token-here" \
-H "Content-Type: application/json" \
-d \
'{
"to": "2015-11-22T19:26:15Z",
"skipIntermediatePeriods": true,
"handleAmendments": false
}'
In the code you are extending certain modules based off of the status code.. i.e. CurbFu::Response::BadGateway
if the code is 502. I need access to this status message in my code (i.e. "Bad Gateway") like net/http provided via the #message method. I don't see any way of getting this from CurbFu. What do you think about adding a #method onto all of the Information modules?
The url in the readme is http://github.com/curb-fu
which is a 404.
Hey There,
is it possible to have follow redirect ability
or probably it's already there?
Cheers
Wedy
CurbFu 0.4.4 depends on json gem but that gem is not listed as a dependency in the gemspec.
I noticed the DELETE method doesn't allow extra params to be passed in. Maybe there's a good reason for this, but I've made the following change and it seems to work:
diff --git a/lib/curb-fu/request/base.rb b/lib/curb-fu/request/base.rb
index cc59c25..2cd3c09 100644
--- a/lib/curb-fu/request/base.rb
+++ b/lib/curb-fu/request/base.rb
@@ -82,8 +82,8 @@ module CurbFu
CurbFu::Response::Base.from_curb_response(curb)
end
- def delete(url)
- curb = self.build(url)
+ def delete(url, params = {})
+ curb = self.build(url, params)
curb.http_delete
CurbFu::Response::Base.from_curb_response(curb)
end
I've forked the project with this patch here: https://github.com/bdondo/curb-fu
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.