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
2
votes
1 answer

How do I view the response cookies from a HTTParty get request?

I'm using httparty to do a GET request to a certain website. I need the response cookies in order to successfully make a POST request to login. rest_client makes it really easy, all I have to do is: get_request =…
narzero
  • 2,199
  • 5
  • 40
  • 73
2
votes
1 answer

RestClient mailgun error "message": "'from' parameter is missing"

I am using RestClient in my rails app to send emails. The following Curl command works: curl -s "https://api:key-XYZ@api.mailgun.net/v2/sandbox30000.mailgun.org/messages" \ -F from='Mailgun Sandbox ' \ …
aswani521
  • 317
  • 4
  • 13
2
votes
1 answer

How to check response code use rest-client Resource

I'm fairly new to Ruby. I'm trying to write a RSpec test against the following class: require 'rest-client' class Query def initialize @@log = Logger.new(STDOUT) RestClient.log = @@log @@user = "joe@example.com" @@password =…
neontapir
  • 4,698
  • 3
  • 37
  • 52
2
votes
1 answer

Working in Internet explorer but didnt in firefox

I am trying to access a rest webservice through the internet explorer. I am getting method not allowing, but when i am trying to access from the rest client of the firefox i am getting block by proxy. Since ie doesnt have rest client i tried where…
ramesh027
  • 796
  • 1
  • 10
  • 27
2
votes
2 answers

Find the redirect-url for POST request in rest-client

I need to get the redirect url name for the POST request i am making. begin RestClient.post url, :param => p rescue => e e.inspect end Response: "302 Found: You are being
prat0318
  • 571
  • 1
  • 8
  • 19
2
votes
1 answer

CXF Rest Client - Proxy Based API vs CXF WebClient API

I went through http://cxf.apache.org/docs/jax-rs-client-api.html documentation but I am still not sure which type of rest client should be used in what use cases? Can anyone point out the use cases / constraints with examples that would help me in…
Atul
  • 1,694
  • 4
  • 21
  • 30
2
votes
1 answer

Why using a framework to make Http requests in Android instead of using its own classes to make this?

There are many frameworks to make http requests in Android, like Retrofit and Volley. But also, Android has its own classes to make this type of request, like HttpURLConnection and HttpClient So what is the advantage of using some framework like…
androidevil
  • 9,011
  • 14
  • 41
  • 79
2
votes
4 answers

Accessing header params in RestClient API get call

I am doing a RestClient api call to one of my controller as follows: RestClient.get(url,{:secret_key => "abcd"}) But when I am printing the params in my controller as follows: p params I cannot find the secret_key in the controller. From …
Joy
  • 4,197
  • 14
  • 61
  • 131
2
votes
1 answer

How to pass parameter in RestClient get request header and to access the parameter in controller

I am using RestClient in my ruby on rails app to send a get request to an api of my app like the following: RestClient.get(url?params1=¶m2=..) The problem is that I also have to pass the secret API key to access the api in header of…
Joy
  • 4,197
  • 14
  • 61
  • 131
2
votes
2 answers

Getting the last HTTPS Request in Ruby rest-client (like __getLastRequest in php SoapClient)

I'm using the ruby rest-client to send requests to a web service. My requests are working, but I'd like to see the actual request that was sent to the service. I can't do this with Wireshark or tcpdump because I'm using https and don't have access…
Darren
  • 1,071
  • 1
  • 15
  • 39
2
votes
1 answer

Make Rest Client using Spring Rest Template

Here is my spring controller code.. @RequestMapping(value= "/save_item", method = RequestMethod.POST,produces="application/json") public @ResponseBody ModelMap saveItem(ModelMap model, @RequestParam("id") String itemId, @RequestParam("name") String…
rplg
  • 232
  • 3
  • 12
2
votes
2 answers

Trying to query an API with rest-client in rails

I'm using rest-client (worst name ever for a google search) to query an API. Here is my code : def self.list request="http://#{URI.escape @@user}:#{URI.escape @@password}@webservicedomain.com/params/params/" Rails.logger.debug request …
Syl
  • 3,719
  • 6
  • 35
  • 59
2
votes
2 answers

Trying to do post or put using RestClient; getting 422 error

I'm trying to write a small rake task / test script for a rails RESTful API. I'm using the rest-client gem. According to the doumentation the following should work (with app.domain obviously changed) response = RestClient.post…
hershey
  • 465
  • 1
  • 8
  • 19
2
votes
2 answers

C# Post XML file using RestSharp

I have written a method to post messages to an uri. public string RestClientPost(string uri, string message = null) { var client = new RestClient(uri); var request = new RestRequest(Method.POST); …
king jia
  • 692
  • 8
  • 20
  • 43
2
votes
1 answer

Setting RestClient SSL version to SSLv3

Is there a way to force SSL version on a single RestClient connection? I need to set it to 'SSLv3'. I'm able to do that for ALL connections using: OpenSSL::SSL::SSLContext::DEFAULT_PARAMS[:ssl_version] = 'SSLv3' But that of course is too…
Rizon
  • 1,516
  • 4
  • 25
  • 45