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

How to download excel (.xls) file from API in postman?

I have an API endpoint and an Authorization token for that API. The said API is for .xls report download. How can I view the downloaded .xls file using (if possible) Postman? If it is not possible using Postman what are the other programmatic ways I…
axnet
  • 5,146
  • 3
  • 25
  • 45
63
votes
3 answers

What is default timeout value of RestSharp RestClient?

Anybody aware of default timeout value of RestSharp RestClient ?
theGeekster
  • 6,081
  • 12
  • 35
  • 47
63
votes
24 answers

Testing REST webservices

My organization is working on building RESTful webservices on JBoss appserver. The QA team is used to testing SOAP webservices so far using SoapUI. SoapUI has a new version that has REST capabilities. We're considering using that. Are there any…
anjanb
  • 12,999
  • 18
  • 77
  • 106
43
votes
1 answer

HttpStatus become deprecated in API level 22

Usually I used to check for the server different code responses in my RestClient class using the org.apache.http.HttpStatus class as the following example: if (HttpStatus.SC_OK == restClient.getResponseCode()) { //200 OK (HTTP/1.0 - RFC…
Sami Eltamawy
  • 9,874
  • 8
  • 48
  • 66
42
votes
5 answers

How to debug/display request sent using RestClient

I am trying to use RestClient to access a webservice using post method. I am sending the authorization token as specified but I am still getting a 403 status error which means I am forbidden to use that api. Is there any way that I can see the…
user3075906
  • 725
  • 1
  • 8
  • 19
42
votes
1 answer

How to set timeout in RestClient gem in Ruby?

I am using RestClient gem by making get call to the server through it. The question is how do I set the timeout from client side. RestClient.get "http://127.0.0.1:7819/tokenize/word/stackoverflow" I want to set it to 10 seconds. Thanks in…
sravan_kumar
  • 1,129
  • 1
  • 13
  • 25
41
votes
6 answers

How to handle exceptions with Ruby Rest-Client

I recently switched from Ruby's Net:HTTP class to rest-client 1.6.7. I find it a lot easier to form requests, but unlike Net:HTTP request, when rest-client gets anything other than a 200, the request dies. I've tried putting a breakpoint directly…
tpow
  • 7,600
  • 11
  • 59
  • 84
35
votes
5 answers

How do I do basic authentication with RestClient?

Does anyone know how to do basic authentication with RestClient? I need to create a private repository on GitHub through their RESTful API.
never_had_a_name
  • 90,630
  • 105
  • 267
  • 383
30
votes
4 answers

How to set multiple headers at once in Spring WebClient?

I was trying to set headers to my rest client but every time I have to write webclient.get().uri("blah-blah") .header("key1", "value1") .header("key2", "value2")... How can I set all headers at the same time using headers()…
25
votes
1 answer

Getting "400 This page expects a form submission" when making a rest call to trigger a Jenkins Job

I need to trigger a Jenkins Job from my Java code.The Jenkins API expects a application/x-www-form-urlencoded Content-Type and I am able to trigger the job (using Basic AUTH) from Postman Rest Client.However When I try to the same from my java…
soumitra goswami
  • 818
  • 6
  • 29
22
votes
1 answer

Insomnia REST Client - Set "Content-Type" for multipart/form-data

TL;DR How can I set the Content-Type headers for each individual file/input/text in a multipart/form-data request (in Insomnia)? I'm trying to POST to the OneNote API (HTTP description) using the Insomnia Rest Client. Per the documentation, I need…
Diode Dan
  • 4,801
  • 6
  • 25
  • 34
20
votes
6 answers

How to develop a simple REST Client using Swagger codegen?

I'm learning about Swagger and how to generate REST Client using Swagger codegen. I know how to do documentation with Swagger, also I know how to generate a simple REST Server with Swagger, but I don't know how to generate a simple REST Client with…
elvis
  • 956
  • 9
  • 33
  • 56
19
votes
2 answers

How to upload a file using a rest client for node

I have a REST client on node, and I'm trying to upload pdf a file to another REST webserver which provides the ability to parse my pdf and extract some data. Basically it is a service. The npm package that I use is:…
Andrei
  • 7,509
  • 7
  • 32
  • 63
19
votes
3 answers

Tool for testing RESTful Web services

I am trying to evaluate the right tool to test RESTful Web services and eventually automate the same for our project. Wondering, what are the specifications I need to look for such test, when i compare various tools on internet. Definitely, one of…
user2640248
  • 393
  • 1
  • 4
  • 14
19
votes
6 answers

Ruby error: cannot load such file -- rest-client

I am using Ruby on Rails 4. I am trying to require 'rest-client' in my controller so that I can parse the login information I am getting from a form and send it to an API. I can verify that the gem is installed and is also in my Gemfile on the…
Jerrod
  • 195
  • 1
  • 1
  • 5
1
2 3
62 63