All Questions
23 questions
0
votes
1
answer
275
views
make a request using curl, equivalent to a REST_CLIENT request
I'm using the following request in Curl
curl -X GET -k -H 'Content-Type: application/json' -H 'Authorization: Bearer XXXXXXX' -H 'RowId: 100' -i 'https://url.xxx/row'
and the request using ...
0
votes
1
answer
811
views
Proper way to upload a doc to FSCrawler for indexing in Elasticsearch
I'm prototyping a Rails application to upload documents to FSCrawler (running the REST interface), to incorporate into an Elasticsearch index. Using their example, this works:
response = `curl -F "...
1
vote
1
answer
1k
views
How to convert a cURL multipart/form-data POST request to ruby request using rest-client?
I have to implement the curl POST request listed below in Ruby using Rest-Client so that I can upload a file to my server.
curl -X POST --header 'Content-Type: multipart/form-data' --header 'Accept: ...
2
votes
2
answers
536
views
How to convert a CURL request to Ruby Gem HTTPClient
I am trying to convert this CURL request:
curl \
-F 'slideshow_spec={
"images_urls": [
"<IMAGE_URL_1>",
"<IMAGE_URL_2>",
"<IMAGE_URL_3>"
],
"...
0
votes
1
answer
40
views
Ruby request headers but also a ?tag=tag
I am trying to send an API call to consul using a ruby script and I have a command that should be close to what I need but I can't get the rest to work.
RestClient::Request.execute(method: :get, url: ...
0
votes
2
answers
3k
views
Rest client post with username and password
curl --request POST \
--url https://example.com/token/grant \
--header 'password: password' \
--header 'username: user' \
--data '{"app_key":"my_app_key","app_secret":"my_app_secret"}'
I am ...
3
votes
0
answers
896
views
Post Request from client With Proper Headers Always return 401- UnAuthorized
Am a newbie to ruby. I am trying to invoke a REST API from ruby code. I have tried the code with both as standalone ruby code and inside a application using sinatra. But am facing same issue every ...
2
votes
2
answers
3k
views
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}'...
1
vote
0
answers
80
views
curl type and ruby rest client
I am not able to translate the curl command into ruby rest-client
curl 'http://localhost:8080/../attachments' -H "Content-Type: multipart/form-data" -H "CMD-Authorization: xxxx" -X POST -F attachment=...
7
votes
3
answers
13k
views
How to send data in a post request with RestClient
I'm trying to mimic a curl request using the RestClient Ruby gem, and so far, I've been having a lot of trouble trying to send in a payload. My curl request looks something like this
curl URL -X ...
2
votes
1
answer
2k
views
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 ...
0
votes
1
answer
380
views
Ruby rest-client returning 401 while curl command works
I have a working curl command which returns exactly what I want, bunch of JSON:
curl -D- -u username:password -X GET -H "Content-Type: application/json" https://stash.address.net/rest/api/1.0/...
0
votes
1
answer
290
views
How to convert curl code to ruby
I'm in trouble to convert the curl code below to ruby using Rest-Client library.
curl code:
curl https://my_url -u user_token: -F "data[price]=$ 100,00"
Ruby code that I tried without success:
...
0
votes
1
answer
2k
views
make a request using REST_CLIENT, equivalent to a curl request
I am trying to make this curl request using rest_client, and I keep getting it wrong. How can I do it?
curl request: it is working well and returning an access token from yahoo.
curl -u "<...
2
votes
1
answer
1k
views
Using RestClient instead of curl -- how do I do that?
I am trying to use RestClient to do the following which is currently in Curl:
curl -H "Content-Type: application/json" -X POST --data '{"contacts" : [1111],"text" : "Testing"}' https://api.sendhub....
0
votes
2
answers
1k
views
Ruby equivalent of this curl command
curl -s -XPOST localhost:9200/_bulk --data-binary @filename.json
I am looking at RestClient gem and cant figure out how to do this. I need this for making a bulk request to elasticsearch.
0
votes
2
answers
25k
views
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 ...
0
votes
1
answer
2k
views
Ruby Multi-part Form Upload with RestClient
I'm working on a ruby application, and am trying to upload a file to box.net. I have it working with the curl call
curl https://www.box.com/api/2.0/files/data -H "Authorization: BoxAuth api_key=<...
3
votes
1
answer
10k
views
Ruby - Uploading a file using RestClient post
I have a cURL that I am trying to translate into Ruby.
the cURL is this:
curl -i -k -H "Accept: application/json" -H "Authorization: token" -H "Content-Type: image/jpeg" -H "Content-Length: 44062" --...
0
votes
1
answer
1k
views
http requests time out with ruby (net/http and rest-client) but fast with curl + py
I'm calling a java service via its http endpoint (embedded jetty). The service handles async http requests with a timeout of 5s, and reliably works when I call it from the browser with url params, or ...
3
votes
3
answers
1k
views
Re-factoring a CURL request to Ruby's RestClient
I'm having trouble translating this CURL request into Ruby using RestClient:
system("curl --digest -u #{@user}:#{@pass} '#{@endpoint}/#{id}' --form image_file=@'#{path}' -X PUT")
I keep getting 400 ...
3
votes
1
answer
6k
views
How can I use a PEM certificate with password?
I'm having plenty of trouble trying to use a certificate that has a password on ruby. I'm using rest-client, but that's not a requirement.
This is the cURL-equivalent of the call I need to make:
...
0
votes
1
answer
3k
views
RestClient for Ruby with smarkets.com api - Curl to RestClient
the api I'm working with is here:
I'm able to log in fine and get back an auth token, but cant figure out how to do anything that requires a token. I get back a forbidden response when I try to get ...