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

How to handle downloading file progress by DropNet

I'm using DropNet to download file from Dropbox, I see it use the RestClient for execute the reques. My question: Is there anyway to get progress status during the Download? I mean, if I'm downloading a few Megabyte file size, how I'll know that the…
Joseph
  • 1,716
  • 3
  • 24
  • 42
0
votes
1 answer

How to send username and password using RestClient

How do I send the username and password in a post using RestClient? My client code is below: response = RestClient.post 'http://localhost:3000/api/rules', :name => "me", :password => "12345", :books => {:book_name => "Harry Porter", …
Kidada
  • 215
  • 1
  • 12
0
votes
2 answers

How do i pass parameters as well as set headers with rest_client in http api call

With rest_client gem I have to pass parametes and set http headers as well. parameters- {"module"=>{"id"=>376373}, "name"=>"test workflow", "playbooks"=>[{"name"=>"shell_book.yml"}]} headers- {Accept => application/json, content-type =>…
Shona
  • 91
  • 2
  • 9
0
votes
1 answer

How to test if RestClient is returning a file or a JSON?

I'm calling a URL that either returns a file or a JSON with an error message. So, for example resp = RestClient.get "my_url" => "\037\213\b\b\n\206XR\002\3....." and resp = RestClient.get "my_url" => "{\"status\": 1}" I need to define if the…
fotanus
  • 19,618
  • 13
  • 77
  • 111
0
votes
2 answers

Convert Curl command line in Rails

This is my curl command which works nicely in Command line : curl --data @order_new.json \ -H "X-Augury-Token:My_token_goes_here" \ -H "Content-Type:application/json" \ …
Ajay
  • 4,199
  • 4
  • 27
  • 47
0
votes
1 answer

Twitter REST API with Rails rest-client

I'm trying to connect to Twitter's REST API using application-only authentication. I get the bearer token, but the GET request doesn't work. token = TOKEN response = RestClient.get…
0
votes
1 answer

how can i post data using Mozilla rest add-on using mailgun api

I'm using this Mozilla ADD-ON to post the data in mailgun API RestClient Content-Type:application/json URL I'm using https://api.mailgun.net/v2/sandbox42924.mailgun.org/messages Json Data I'm posting [ { "from": "Kaushik…
Kaushik
  • 2,072
  • 1
  • 23
  • 31
0
votes
3 answers

DELETE method with a payload using Ruby Rest:Client?

While I don't think it is very restful to have to include a payload in a DELETE request. I ran into an instance where I am testing a service that requires a payload for DELETE. Might there be a way using Ruby's Rest Client to accomplish this?…
Josh
  • 460
  • 1
  • 5
  • 20
0
votes
2 answers

Rest-Client: how to post multipart/form-data?

I have to implement the curl POST request below listed, in Ruby, using Rest-Client. I have to: send params in header; send params (that do not contain a file) as multipart/form-data: $ curl -X POST -i -H "Authorization: Bearer…
Giorgio Robino
  • 2,148
  • 6
  • 38
  • 59
0
votes
0 answers

Rest-client Authorization Header unauthorized but working with curl

I have the following API secured through: def restrict_access authenticate_or_request_with_http_token do |token, options| ApiKey.exists?(access_token: token) end end The following curl works: curl --data ""…
Delos Chang
  • 1,823
  • 3
  • 27
  • 47
0
votes
1 answer

WCF service inside a Web application is not working through RESTCLIENT?

I have added a RESTful WCF service inside a Web application(Righclicked solution and added WCF service) and while running it is exposing the url as svcutil.exe http://localhost:62783/Service1.svc?wsdl but i have tried calling that service…
bala3569
  • 10,832
  • 28
  • 102
  • 146
0
votes
1 answer

Jersey 2 getLinks() returns empty set despite links being in the resource

EDIT shorter version Ok so looking at my own post I realize this is perhaps not the shortest thing to read, so I thought I would write a more concise version with some more hands-on details. I am using Jersey 2 client framework to code against the…
0
votes
1 answer

Express.js post request gives undefined

I used to parse post request body with express.js, but now it started to give undefined when i try to log req.body.gsm. {"gsm":"10"} this is my post data, and I make the request with a rest client. app.configure(function(){ …
user3074649
0
votes
1 answer

POST request delete + symball

I have this code httpUriRequest = new HttpPost(address.toString()); ((HttpPost)httpUriRequest).setEntity(new ByteArrayEntity(restParams.postData())); httpUriRequest.setHeader("Content-Type", "application/x-www-form-urlencoded; charset=utf-8"); When…
Hayk Nahapetyan
  • 4,452
  • 8
  • 42
  • 61
0
votes
0 answers

Access token is not getting printed in console in Ruby on Rails

I am trying to fetch gmail contacts. I gave the following URL in…
Dinesh
  • 45
  • 10