Hi all,
I'm using restclient for a multipart form to send data to a restful web service (it's Panda video encoding service).
The trick though, is that the file I am passing into restclient (Technoweenie branch) is coming from my own form that a user submits.
So, lets walk through this. A user posts a file to my rails app. In my control...
I have a spooling app that sits between a Ruby on Rails app, and a few Pandastream instances. Prior to the creation of the spooling application, the Rails app posted it's file data straight to Panda without issue.
I've got the spooler receiving the file information and connection to the appropriate instance to pass the file data on, bu...
I need to configure my gmail account(s) programmatically with Ruby. I checked out the apps api and it looks like the simplest possible solution would be to use ClientLogin for logging in and a simple XML PUT for changing the forwarding setting, for example.
I wrote a little test script like so:
http://gist.github.com/373457
It would a...
I am trying to find a way to use the Postful API and I need to post an image in the body of the request. I am trying to use rest-client (but am open to other ways):
The error I get when I post is HTTP status code 422
Basically, I'm clueless and need guidance. :\
class PostfulsController < ApplicationController
require 'rest_client...
Hi, this is my code and I don't know how to debug it because I just get an "internal server error":
I am trying to HTTP POST to an external ASPX:
def upload
uri = 'https://api.postalmethods.com/2009-02-26/PostalWS.asmx' #postalmethods URI
#https://api.postalmethods.com/2009-02-26/PostalWS.asmx?op=UploadFile
#http://www.p...
I have tried to do the following, but the web-service is NOT REST and does not take multi-part. What do I do in order to POST the image?
@response = RestClient.post('http://www.postful.com/service/upload',
{:upload => {
:file => File.new("#{@postalcard.postalimage.path}",'rb')
}
...
Hi,
I am trying to send a JSON data to a Sinatra app by RestClient ruby API.
At client(client.rb) (using RestClient API)
response = RestClient.post 'http://localhost:4567/solve', jdata, :content_type => :json, :accept => :json
At server (Sinatra)
require "rubygems"
require "sinatra"
post '/solve/:data' do
jdata = params[:data...
The following error is displayed in command prompt in Windows 7
C:\Users\rd\Desktop\Training\Problem2\sudoku\sudoku>gem install rest-client
WARNING: RubyGems 1.2+ index not found for:
http://gems.rubyforge.org/
RubyGems will revert to legacy indexes degrading performance.
ERROR: could not find gem rest-client locally or in a ...
I tried the following to upload a file with RestClient, but the resulting POST always uses the file's filename ("testfile.txt") instead of "file_name.txt":
RestClient::Resource.new(path, resource_options).post(:transfer => { :path => "file_name.txt" }, :upload => File.new('/tmp/testfile.txt', 'rb'))
...
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 or post a private URL.
they give an example of the request that needs to be sent using curl:
curl \
--header 'Authorization: User...
A little background: I'm using the WCF REST Starter kit, and I'm creating a wrapper for a specific API I'm consuming. There are common query string parameters that I need to pass whenever I hit any of the exposed methods, such as an API key.
To me, it would be easier to make such common parameters a part of the wrapper class. Then I cou...
Hi there,
I've been trying to mock a rest-client nested resource to test my class. Here's the test:
require 'rest_client'
require File.join(File.dirname(__FILE__), "/../src/job_resource.rb")
describe JobResource, "#has_stagein" do
before :each do
response = mock(String).stub!(:code).and_return(200)
job_resource = mock(Rest...
Using
http://github.com/archiloque/rest-client
When posting a file using this line, the content type is set as
Content-Type: multipart/form-data; boundary=301405
in the header, by default.
RestClient.post '/data', :myfile => File.new("/path/to/image.jpg", 'rb')
I tried this and it still sets the header multipart/form-data.
RestC...
Model ..
def self.upload_client_document(params)
client_document = self.new :uploaded_data => params[:Filedata],:client_id => params[:client_id],:document_name => self.default_document_name,:document_description => self.default_description_name
client_document.rename_document_name
client_document.save!
# RAILS_ROOT + client_docu...