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
0 answers

RestClient not uploading multiple files

I am trying to call external API and send attachments. Following is working example of curl and multiple attachment curl -v -u xxxx@domain.in:password -F "helpdesk_ticket[attachments][][resource]=@/tmp/upload_test_1.txt" -F …
Manwal
  • 23,450
  • 12
  • 63
  • 93
2
votes
1 answer

POST method in RestClient using Rails

I am trying to post values using RestClient. It always shows the following error. RestClient::BadRequest (400 Bad Request): Tried all the answers in SO. Nothing helped. This is my code. response = RestClient.post…
kelvin
  • 179
  • 4
  • 12
2
votes
3 answers

How to get redirect URL withour following in RestClient

if resp.code == 302 resp.follow_redirection(req, result, &block) else final_url = req.url resp.return!(req, result, &block) final_url end This works to get the redirect URL. But how to get it without following redirects
user3636388
  • 187
  • 2
  • 24
2
votes
1 answer

Pass parameters in RestClient post request

I want to send parameters with a POST request using the RestClient gem (but I don't want to pass the params as JSON). In a GET request, I would have: url = "http://example.com?param1=foo¶m2=bar" RestClient.get url How can I pass the same…
Graham Slick
  • 6,692
  • 9
  • 51
  • 87
2
votes
1 answer

Sending a POST request with RestClient and Authentication headers

I have the following curl request that I would like to translate into a RestClient API request. curl -H 'Content-Type: application/json' -H 'Accept: application/json' -H 'Authorization: Token user_token="tokenhere", email="email@myemail.com"' -X…
locoboy
  • 38,002
  • 70
  • 184
  • 260
2
votes
1 answer

WSLITE: Building JSON REST Request from Map causes StackOverflowError

I have been stuck with this problem for a while now. Couldn't find any solution so far. Basicall I am doing nothing out of the ordinary. I have a Method to configure and send a Rest Request using Wslite and this method accepts a map as payload to…
Christoph Zabinski
  • 327
  • 2
  • 5
  • 17
2
votes
1 answer

NoMethodError trying to use the Ruby RestClient

I'm trying to use RestClient to talk to an API and I'm getting this error and backtrace: >> RestClient.post "http://localhost:8081/accounts", {}.to_json, content_type: :json, accept: :json NoMethodError: undefined method `[]' for #
Pablo Fernandez
  • 279,434
  • 135
  • 377
  • 622
2
votes
0 answers

How to install self signed certificate for Google ARC "detached" app?

I have just noticed that Google changed its ARC app to be detached from Chrome browser. I am getting this error (see screenshot below): Install self signed certificate in Chrome The app cen't work if the self-signed certificate is not installed in…
jazzblue
  • 2,411
  • 4
  • 38
  • 63
2
votes
2 answers

How to properly format json to send over using RestClient

I am trying to implement this javascript code var token = ""; function sendTextMessage(sender, text) { messageData = { text:text } request({ url: 'https://graph.facebook.com/v2.6/me/messages', qs:…
Petros Kyriakou
  • 5,214
  • 4
  • 43
  • 82
2
votes
2 answers

curl request in ruby RestClient

The fastbill API states in its docu to make this curl request in order to receive information: curl -v -X POST \ –u {E-Mail-Adresse}:{API-Key} \ -H 'Content-Type: application/xml' \ -d '{xml body}' \…
DonMB
  • 2,550
  • 3
  • 28
  • 59
2
votes
1 answer

How to create REST client for external world REST services

How can I create a rest client using JAX-RS Client fluent API for external world REST service? E.g. suppose a service returns a person objects having two field name and age. Whatever examples/tutorials I came across, they do the same thing as below…
SHA
  • 317
  • 4
  • 15
2
votes
2 answers

How to disable self signed certificate at client in java?

I am having genuine certificate "salientrisk.crt" and "salientrisk.key" , Server is configured as SSL server with these certificate , now on client side if i have the same certificate then only it should be able to do handshake other wise it should…
user4772709
2
votes
1 answer

Receive Image as multipart file to rest service

I am exposing a restful webservice, where i want to accept image as multipart file in the json body request i dont find anywhere a sample json request so as to hit my rest service from a rest client.my rest service uses this field above the class…
Jill
  • 163
  • 1
  • 5
  • 20
2
votes
2 answers

How to invoke Spring STOMP web socket method from rest client

My Java Code which intercepts all the calls with the URL /hello (Back) : @Controller public class GreetingController { @MessageMapping("/hello") @SendTo("/topic/greetings") public Greeting greeting(HelloMessage message) throws Exception…
Pratap A.K
  • 4,337
  • 11
  • 42
  • 79
2
votes
1 answer

Rails: How to send file from S3 to remote server

I've been hunting around and can't seem to find a good solution for this. My Rails app stores it's files in Amazon S3. I now need to send them to a remote (3rd party) service. I'm using RestClient to post to the 3rd party server like this: send_file…
BoomShadow
  • 912
  • 1
  • 18
  • 31