Questions tagged [rest-client]

REST Client is an open-source HTTP and REST client for Ruby.

REST Client is an open-source HTTP and REST client for Ruby originally created by Adam Wiggins and now maintained by Andy Brody. It was inspired by Sinatra's micro-framework style of specifying actions: get, put, post, delete.

Github

The code repository and issue tracker can be found on github:

https://github.com/rest-client/rest-client

Resources

940 questions
7
votes
1 answer

RestClient failing to GET resource using SSL client certificate

I'm trying to use RestClient to retrieve a page that's secured using an SSL client certificate. My code is as follows: require 'restclient' p12 = OpenSSL::PKCS12.new(File.read('client.p12'), 'password') client =…
Duncan Bayne
  • 3,870
  • 4
  • 39
  • 64
6
votes
2 answers

Getting ssl.SSLHandshakeException when using REST client with header but works fine with PostMan

I have an external REST resource with below details: The URL: abc.com/orders (the domain is with https) I need to pass UserID as an HTTP header with key "user" value is "abcd" This would return an JSON response I am using below Java code for…
J. Doe
  • 63
  • 1
  • 1
  • 5
6
votes
3 answers

Rails RestClient POST request failing with "400 Bad Request"

Looking at the docs there aren't any good examples of how to make a POST request. I need to make a POST request with a auth_token parameter and get a response back: response = RestClient::Request.execute(method: :post, url:…
Tom
  • 9,275
  • 25
  • 89
  • 147
6
votes
2 answers

How can I get Ruby's RestClient to use a multi-valued query parameter?

Using the RestClient gem, I need to create a request such as the following: GET http://host/path?p=1&p=2 What is the proper syntax to accomplish this? Note that the receiving host is not Rails. Tried: resource = RestClient::Resource.new(…
cmonkey
  • 4,256
  • 1
  • 26
  • 46
6
votes
3 answers

Stub multipart requests with webmock/rspec

I have been trying for a while to stub multipart requests using webmock and have not found a satisfying solution. Ideally, I would like to stub the request as follow: stub_request(:post, 'http://test.api.com').with(:body => { :file1 =>…
Kamchatka
  • 3,597
  • 4
  • 38
  • 69
6
votes
6 answers

Fusion Tables: Why do I keep getting a "400 Bad Request" error when trying to update a table style via Ruby's RestClient gem

I'm trying to update a style for one of my Fusion Tables by using the Ruby gem RestClient. Here's my code: require 'rest_client' tableId = '' styleId = '' key = '
user1626730
  • 3,783
  • 5
  • 20
  • 24
6
votes
3 answers

Using restclient with multipart posts

I'm using restclient for a multipart form to send data to a restful web service (it's Panda video encoding service). The trick though, is that the file I am passing into restclient (Technoweenie branch) is coming from my own form that a user…
Dan Frade
  • 1,001
  • 9
  • 13
6
votes
1 answer

Is there a well-typed Scala (or Java) library to consume JSON Web APIs?

I want a simple rest client library for Java (or Scala) that let's me easily do GETs/PUTs/POSTs/DELETEs etc on a JSON REST API and deserialize the JSON responses into Java objects in a type-safe way e.g. RestClient client = new…
pathikrit
  • 32,469
  • 37
  • 142
  • 221
6
votes
2 answers

any frameworks to handle REST Client server list?

The idea is that REST Client can be configured with list of REST Servers. So the servers list will rotate on the REST Client in a round robin fashion. e.g. REST Client Application. I'll be configuring server list (REST_SERVER1,REST_SERVER2,…
Njax3SmmM2x2a0Zf7Hpd
  • 1,354
  • 4
  • 22
  • 44
6
votes
1 answer

Ruby RestClient.post for login form

I am attempting to login to a site using the following code: require 'rubygems' require 'nokogiri' require 'open-uri' require 'csv' require 'restclient' HEADERS_HASH = {"User-Agent" => "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_4)…
Nick5a1
  • 917
  • 3
  • 15
  • 28
6
votes
5 answers

Logging RestClient in a Rails app

I'd like to debug the request my Rails app makes with RestClient. The RestClient docs say: To enable logging you can set RestClient.log with a ruby Logger or set an environment variable to avoid modifying the code (in this case you can use a file…
user94154
  • 16,176
  • 20
  • 77
  • 116
5
votes
2 answers

How to make an async POST request in Ruby using RestClient

Can we make an asynchronous POST request to a resource in Ruby using the RestClient library ( https://github.com/archiloque/rest-client )?
Kalyan Maddu
  • 4,123
  • 2
  • 21
  • 26
5
votes
1 answer

The size of the handshake message (X) exceeds the maximum allowed size (32768):spring boot resttemplate

I am getting the above error when making post request, using spring resttemplate with mutual authentication. @Bean public RestTemplate restTemplate() throws UnrecoverableKeyException, NoSuchAlgorithmException, KeyStoreException,…
Mihir
  • 121
  • 1
  • 7
5
votes
1 answer

creating a ruby File object from Magick::Image

I'm trying to post watermarked images to a url using rmagick and rest-client. When I generate the composite image, I save it (.write), read it back in with File.new, and then post that File object. Ideally though, I'd like to bypass the write…
john h.
  • 191
  • 2
  • 8
5
votes
2 answers

The mapping definition cannot be nested under a type [_doc] unless include_type_name is set to true

My API version is 6.3 and I try to create index. The failure says "The mapping definition cannot be nested under a type [_doc] unless include_type_name is set to true" .Here is my code: CreateIndexRequest indexRequest = new…
Zheyou Guo
  • 87
  • 1
  • 1
  • 4