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
12
votes
3 answers

Proper Android REST client

I made my own REST client library for an Android application, but after watching the Google I/O presentation on the subject I realized I had it all wrong (precisely what they show slide 9). Now I am looking to do it again the right way, but I'm…
MasterScrat
  • 7,090
  • 14
  • 48
  • 80
12
votes
2 answers

How to cache REST API response in java

I am building an app in java.I hit api more than 15000 times in loop and get the response ( response is static only ) Example ** username in for loop GET api.someapi/username processing end loop ** It is taking hours to complete all the…
thaveethu gce
  • 585
  • 1
  • 9
  • 20
12
votes
2 answers

Spring Rest Client Exception Handling

I am using spring RestTemplate to consume rest services(exposed in spring rest). I am able to consume success scenarios. But for negative scenarios, service returns error messages and error codes. I need to show those error messages in my web…
Abhendra Singh
  • 1,959
  • 4
  • 26
  • 46
12
votes
3 answers

nginx redirects POST requests to GET request

I have Rails 4.1 application with runs on puma web server. I use nginx as a proxy server. Several days ago everything worked very well. I updated my application, and suddenly some POST requests started to redirected to same url but as GET request.…
Zhomart
  • 702
  • 1
  • 7
  • 19
12
votes
1 answer

What is the difference between timeout and open timeout?

In the Ruby RestClient gem, what's the difference between the timeout and open-timeout functionality? http://www.ruby-doc.org/gems/docs/w/wgibbs-rest-client-1.0.5/RestClient/Resource.html#method-i-open_timeout I didn't get anything from the doc file…
Pratik Bothra
  • 2,642
  • 2
  • 30
  • 44
12
votes
3 answers

Stubbing RestClient response in RSpec

I have the following spec... describe "successful POST on /user/create" do it "should redirect to dashboard" do post '/user/create', { :name => "dave", :email => "dave@dave.com", :password => "another_pass" …
RobA2345
  • 848
  • 1
  • 8
  • 12
12
votes
2 answers

How do I set the user agent for Ruby's RestClient?

I'm interested in setting my own user agent when using the ruby RestClient gem. http://github.com/archiloque/rest-client However, I can't find any documentation on how to do so. Any pointers?
Han
  • 5,374
  • 5
  • 31
  • 31
11
votes
2 answers

RestClient strips out the array of hashes parameter with just the last hash?

I have a condition where i need to pass a parameter as an array of hashes which looks like this: The following is the Rack::Test post method for API call. post "#{url}.json", :api_key => application.key, :data =>…
millisami
  • 9,931
  • 15
  • 70
  • 112
11
votes
3 answers

MessageBodyProviderNotFoundException: MessageBodyReader not found for media type=text/html;charset=UTF-8

I am trying to use openfire REST-API-Client. I am calling method to add user to the openfire using following code. AuthenticationToken authenticationToken = new AuthenticationToken("username","password"); RestApiClient restApiClient = new…
ajm
  • 12,863
  • 58
  • 163
  • 234
10
votes
1 answer

How do I do Rails Basic Authorization with RestClient?

I am trying to post a request to a REST service (HP ALM 11 REST API fwiw) using rest-client and keep getting the Unauthorized response. Could be I am not following the docs right but also I am not sure I am doing the headers properly. So far my…
ScottJShea
  • 7,041
  • 11
  • 44
  • 67
10
votes
3 answers

How to output the generated request and response from Groovy RestClient?

i am currently using the RestClient and cannot seem to figure out how to output the request xml and response xml for debugging and informational purpose... I tried the solution mentioned…
Marco
  • 15,101
  • 33
  • 107
  • 174
10
votes
1 answer

Reading the body of a 400 response?

I am trying to read the body of a 400 response with the rest-client gem. The problem is that rest-client responds to 400 by throwing it as an error, so I can't figure out any way to get the body text. Here's the motivating example. Consider this…
Jonah
  • 15,806
  • 22
  • 87
  • 161
10
votes
2 answers

HttpMethod.Delete not working with RestTemplate of Spring-Android

I am trying to use DELETE method of HttpMethod. The code that I am using for that is response = restTemplate.exchange(url, HttpMethod.DELETE, requestEntity, Response.class); I am also using JacksonJson for mapping json. The delete functionality…
thefrugaldev
  • 1,619
  • 4
  • 18
  • 36
10
votes
2 answers

getting csrf tokens for json post requests to a rails app

I have been playing around with using rest-client to access a rails app I have written. I've written a quick script to log in and make a post request. Everything is working but I did have to work round the fact that no authenticity_token is served…
Conor
  • 775
  • 3
  • 10
  • 23
9
votes
1 answer

Is the rest client app design approach in google io 2010 still up to date?

two years past, there comes fragment, intent service, cursor loader. Is the approach still up to date, or is there any better or mature pattern to design an android rest client, especially compare to the option B (I don't have the privilege to post…
Ren Ji
  • 115
  • 7
1 2
3
62 63