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
5
votes
2 answers

Where should I store the token when calling an API from my Rails app?

I'm writing a library to call a third party API so that it can be used by a Rails app. To authenticate, the API initially uses basic auth to return a token which is used for all other requests. Tokens remain valid for 1 hour, and multiple tokens can…
Simon
  • 1,716
  • 1
  • 21
  • 37
5
votes
2 answers

How to change content of Mat-Label without refreshing the page

I have a mat-label which displays Customer End Date. I get the end date initially when I do a GET request to an API. Suppose the end date is 16-05-2099.I display the end date as it is. Now I have a delete button which does a soft delete.It means…
Cpt Kitkat
  • 1,392
  • 4
  • 31
  • 50
5
votes
1 answer

Elasticsearch RestHighLevelClient (6.0.0) -- TimeoutException on runtime

Our application encoutner timeout exception while indexing(store) document in elasticsearch server. It do not frequently happen but approximately once a day. Here are details. pom.xml org.elasticsearch.client
5
votes
3 answers

Ruby rest-client API request for Javascript Blob

I am trying to create a rest-client request in Ruby for the API request that is triggered in this page. (source) From looking at the Javascript in the page, I noticed that there is a Javascript Blob being created and the JSON content appended to…
Michael Victor
  • 861
  • 2
  • 18
  • 42
5
votes
2 answers

Insomnia rest client error

When I do a POST request I am getting this error. Error: connect ECONNREFUSED 127.0.0.1:3000. On the contrary, when I use postman it works. This is the url: http://localhost:3000/users/sign_in And this is my configuration: JSON tab: {"user":…
Gabriel C
  • 263
  • 1
  • 4
  • 8
5
votes
1 answer

POST request to HTTPS using Net::HTTP

This POST request using Ajax works perfectly: var token = "my_token"; function sendTextMessage(sender, text) { $.post('https://graph.facebook.com/v2.6/me/messages?', { recipient: {id: sender}, message: {text:text}, access_token:…
Graham Slick
  • 6,692
  • 9
  • 51
  • 87
5
votes
1 answer

How to get GPS data from Waze with rest-client?

I'm trying to get my GPS data from the Waze app using the rest-client lib. I'm basicly trying to fake a login via the website https://www.waze.com/. After login (you can use JohnDoeSpeedy228:gre@tStory92) when you visit https://www.waze.com/editor/,…
narzero
  • 2,199
  • 5
  • 40
  • 73
5
votes
2 answers

How to Save File using Ruby 2.2.3 and rest-client

I am trying to use a rest API to download a file, it appears to work, but I dont actually have a file downloaded. I am assuming its because its going to memory, and not to my file system. Below is the portion of code responsible. My URL is…
Justin S
  • 774
  • 2
  • 11
  • 22
5
votes
1 answer

Ruby on rails rest client, handling error response

I'm new in ruby (and in programming too) I have built this code: #This method executing a url and give the response in json format def get url return JSON.parse(RestClient::Request.execute(method: :get, url: url)) end And now I'm…
Joel
  • 477
  • 1
  • 8
  • 14
5
votes
1 answer

Mozilla rest client post json object

I am using Mozilla fire fox add-on RESTClient to test my web-services. Up to this I was using POST method by setting header Content-Type:application/x-www-form-urlencoded and data separated by & in request body e.g. id=1&title=abc But now I want to…
Dev
  • 6,570
  • 10
  • 66
  • 112
5
votes
1 answer

NOT FOUND using restclient

My request looks like this but when I try to run this code I get this error: @Grab(group='org.codehaus.groovy.modules.httpbuilder',module='http-builder', version='0.7') import groovy.json.JsonOutput import groovy.json.JsonBuilder import…
pauleng
  • 69
  • 1
  • 5
5
votes
3 answers

SSLError: hostname "W.X.Y.Z" does not match the server certificate

I just started to learn Ruby and after some basic things, I'm trying to understand making REST calls to a service in ruby. I can make get requests to foursquare API without any trouble. On the other hand calls to Cisco CMX API give error. My ruby…
Ahmet Tanakol
  • 849
  • 2
  • 20
  • 40
5
votes
1 answer

How to handle RestClient::ServerBrokeConnection

I am using the latest version of rest-client gem and upon external access I see a lots of RestClient::ServerBrokeConnection errors, how should I handle this? The following call fails response = RestClient::Request.execute(method: :post, url: url,…
Rpj
  • 5,348
  • 16
  • 62
  • 122
5
votes
1 answer

Rest-client log in with authlogic

I am trying to use the Rest-client gem to do a few small tasks for my app which uses Authlogic to authenticate users. From Rest-Client's API, I see that one can post data necessary for the log-in process like this: require…
Nik So
  • 16,683
  • 21
  • 74
  • 108
5
votes
1 answer

Limit size of response read by rest-client

I'm using the Ruby gem rest-client (1.6.7) to retrieve data using HTTP GET requests. However, sometimes the responses are bigger than I want to handle, so I would like some way to have the RestClient stop reading once it exceeds a size limit I set.…
Old Pro
  • 24,624
  • 7
  • 58
  • 106