Questions tagged [curb]

Curb provides Ruby-language bindings for the libcurl, a fully-featured client-side URL transfer library.

Curb provides Ruby-language bindings for the libcurl, a fully-featured client-side URL transfer library. See https://github.com/taf2/curb

125 questions
0
votes
2 answers

Using Ruby Curb gem with API token

Brand new to Ruby. I'm referencing the Curb documentation and attempting to submit a request in curl that utilizes a security token. Here are the 3 parts to my header with my traditional request: My-Security-Token 1234567890 website.com How would…
sparecycle
  • 2,038
  • 5
  • 31
  • 58
0
votes
1 answer

POST JSON data with Curl Multi from ruby

I am using the curb gem to do a Curl Multi post using JSON data. However I am unable to actually get the parameters to get posted and have been unable to figure out how to properly configure the parameters. urls = [ { :url =>…
jwarzech
  • 6,596
  • 11
  • 52
  • 72
0
votes
1 answer

how to post (http-post) content of pdf using ruby?

I am trying to post (raw) content of a PDF in ruby using the following block require 'pdf/reader' require 'curb' reader = PDF::Reader.new('folder/file.pdf') raw_string = '' reader.pages.each do |page| raw_string = raw_string +…
Som Poddar
  • 1,428
  • 1
  • 15
  • 22
0
votes
1 answer

Print only specific headers using Curb gem

I have a question about Ruby gem - Curb. I'm playing around with this gem and have this piece of code: require 'curb' require 'colorize' def err(msg) puts puts msg.red puts 'HOWTO: '.white + './script.rb '.red puts end target =…
Yeez
  • 282
  • 1
  • 3
  • 9
0
votes
1 answer

Getting "error reading X.509 key or certificate file" by using curb, while curl uses the same certificate w/o errors

On Ubuntu trusty-64 with rvm and ruby 2.0.0-p353 using curb 0.8.5 I try to make post request. When I perform it in command line using curl it makes request and returns ok, but when I do the same request in ruby, it fails with error reading X.509…
zuba
  • 1,488
  • 1
  • 17
  • 50
0
votes
1 answer

I am trying to use Curl::Easy.http_put but have some issues with the data argument

I'm struggling with a ruby script to upload some pictures to moodstocks using their http interface here is the code that I have so far curb = Curl::Easy.new curb.http_auth_types = :digest curb.username = MS_API curb.password =…
nucka
  • 559
  • 5
  • 12
0
votes
1 answer

Get filename on server while using Ruby gem Curb

Is there a way to get the filename of the file being downloaded (without having to parse the url provided)? I am hoping to find something like: c = Curl::Easy.new("http://google.com/robots.txt") c.perform File.open( c.file_name, "w") { |file|…
Jikku Jose
  • 18,306
  • 11
  • 41
  • 61
0
votes
1 answer

Ruby Gem Curb version 0.8.5 - Wont install - Windows 7 Setup with RubeMine 6.0.1

I get the following errors, basically trying to get curb to go but it wont. Here is a snapshot of my terminal: gem install curb -- -with-curl-lib=c:/curl-7.33.0/lib Temporarily enhancing PATH to include DevKit... Building native extensions. This…
Jeff Gray
  • 225
  • 1
  • 4
  • 13
0
votes
1 answer

Can't bundle install jruby with curb

I've been trying a few days now to get jruby running (any version between 1.6.8 and 1.7.6). I keep getting bundle install errors. It complains about curb, I installed curl with homebrew and I'm on Mavericks. I have latest xcode installed and…
jdkealy
  • 4,807
  • 6
  • 34
  • 56
0
votes
2 answers

Ruby - open-uri doesn't download a file itself, but just the HTML code of the website

I am trying to use this snippet: open("data.csv", "wb") do |file| file << open("https://website.com/data.php", http_basic_authentication: ["username", "password"]).read end But instead of the desired CSV file, I get just downloaded the HTML…
user984621
  • 46,344
  • 73
  • 224
  • 412
0
votes
1 answer

Why do I get a duplicated curb request?

I'm creating an application, which has authentication based on external API with login/register methods. I have a simple controller called RegistrationsController which fires a request using Curb. This is the controller: class…
mbajur
  • 4,406
  • 5
  • 49
  • 79
0
votes
0 answers

Rails 3.2 using curb gem. error - uninitialized constant LoginController::Curl

I've installed curb gem 1) gem install curb 2) included in gemfile gem 'curb' 3) in boot.rb require 'rubygems' require 'curb' But i get an error when i try to use Curl http = Curl.post('http://localhost:3000/', data ) I get an error…
Elmor
  • 4,775
  • 6
  • 38
  • 70
0
votes
1 answer

rails extract data from simple json response

I need to extract some data from a JSON response i'm serving up from curb. Previously I wasn't calling symbolize_keys, but i thought that would make my attempt work. The controller action: http =…
jahrichie
  • 1,215
  • 3
  • 17
  • 26
0
votes
0 answers

Rails - Curb gem - Failed to allocate memory

During a running task this exception is raised by the Curb gem (https://github.com/taf2/curb). failed to allocate memory It's strange because before the Exception the gem works properly (with others curl calls). Any ideas? I'm using Ruby 1.9.3 on…
damoiser
  • 6,058
  • 3
  • 40
  • 66
0
votes
1 answer

Curb giving me weird error

I installed curb on ruby with this line of code and it said that it installed ok. C:\>gem install curb --platform=ruby -- --with-curl-lib=C:\curl\bin --with-curl-include=D:\curl\include Then I go to run a script that has require 'curb' at the top…
thedarkknight228
  • 535
  • 1
  • 5
  • 9
1 2 3
8
9