Giter Site home page Giter Site logo

curb-fu's People

Contributors

ashb avatar erithmetic avatar hoverlover avatar hypomodern avatar whatcould avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

curb-fu's Issues

Illformed requirement for 0.6.1

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.

0.3.3 gem is empty

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.

Core extensions break .to_params

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

how do I pass headers, URL, and data?

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....

Template is missing

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?

hang inside a controller

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?

SSL Option

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]}"

error trying to POST

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
}'

Add #message onto Response

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?

readme link error

The url in the readme is http://github.com/curb-fu which is a 404.

Follow Redirect

Hey There,
is it possible to have follow redirect ability
or probably it's already there?

Cheers
Wedy

DELETE method doesn't allow extra params to be passed in

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.