Date   

unsubscribe

Welliton Souza <well309@...>
 


Re: tls with ecc and rsa certs

Andy Brody <andy@...>
 

Rest-client provides a thin wrapper around the native Ruby Net::HTTP
where TLS is concerned, so it should support whatever ruby does. Not
all of the functionality is exposed, but the latest version on the
master branch on github has a bunch of extra options there. Support
for client certificates has been around for quite a while, but I'm not
sure about ECC certificates specifically.

On Thu, Apr 10, 2014 at 6:24 PM, Benjamin DuPont <ben@...> wrote:
Does the ruby REST client support ECC certificates? Can multiple client
certificates be registered and selected automatically when the client
connects to a server? Is TLS supported?

--
Ben DuPont
Owner/Operator
nebland software, LLC
ben@... | (920)328-5236
www.nebland.com


tls with ecc and rsa certs

Benjamin DuPont <ben@...>
 

Does the ruby REST client support ECC certificates? Can multiple client
certificates be registered and selected automatically when the client
connects to a server? Is TLS supported?

--
Ben DuPont
Owner/Operator
nebland software, LLC
ben@... | (920)328-5236
www.nebland.com


Set custom headers and cookies

Rafael Righes <righes.testing@...>
 

Hello,

I'm trying to set a custom header which has a value such as "X-Auth-Token_SUFFIX". Same value can be used as a cookie name.

I'm having a hard time to accomplish this using rest-client using the API and something like:

RestClient::Request.execute( :method => :put, :url => "#{@base_uri}/v2/authn/tokens/refresh", :headers => { :accept => "x-auth-token/cookie" }, :cookies => { "X-Auth-Token_SUFFIX" => <here_goes_token_contents> } )

Any help would be appreciated!

Regards,
Rafael Righes


How to do Multipart payload with content type specified for each part

Nathaniel Slater <nateslate@...>
 

I need to send a request that looks like the following, but I cannot figure out how to construct the payload properly with the rest-client:

headers: {
'X-DocuSign-Authentication': dsAuthHeader,
'content-type': 'multipart/form-data'
},
multipart: [{
'Content-Type': 'application/json',
'Content-Disposition': 'form-data',
body: JSON.stringify(data),
}, {
'Content-Type': 'application/pdf',
'Content-Disposition': 'file; filename="' + documentName + '"; documentId=1',
body: fs.readFileSync(documentName),
}],

Any advice would be greatly appreciated.

Thanks,
Nate


RestClient.get 'http://example.com/resource' will return response object or String?

Snow Hellsing <snow.hellsing@...>
 

Hi,

documents at http://rdoc.info/github/rest-client/rest-client and https://github.com/rest-client/rest-client says that, `RestClient.get 'http://example.com/resource'` will return response object.

but when I tried that, found a String object containing response body is returned.

Did I do anything wrong? Or the document is incorrect?

PS: I tried this in rails console, with `gem 'rest-client'` in Gemfile.

Best regards.


Re: Is there a tutorial for rest-client somewhere?

Emile Silvis <emile@...>
 

Thanks Charles, I managed to poke it into working, but that's not a bad idea for any future endeavours.


On Wed, Feb 6, 2013 at 10:06 AM, Charles S van der Linden <sqapro@...> wrote:

I recommend using an http proxy like Fiddler2 Or Charles, and configuring rest-client to use the proxy, it makes it easier to see what you are sending, and compare it with using one of the fine plugins for chrome or Firefox to sent the request "manually"

On Jan 25, 2013 1:14 AM, "Emile Silvis" <emile@...> wrote:
I'm trying to do a basic post, and failing (caveat: I'm new to programming). Thanks.


Re: Is there a tutorial for rest-client somewhere?

Charles S van der Linden <sqapro@...>
 

I recommend using an http proxy like Fiddler2 Or Charles, and configuring rest-client to use the proxy, it makes it easier to see what you are sending, and compare it with using one of the fine plugins for chrome or Firefox to sent the request "manually"

On Jan 25, 2013 1:14 AM, "Emile Silvis" <emile@...> wrote:

I'm trying to do a basic post, and failing (caveat: I'm new to programming). Thanks.


Is there a tutorial for rest-client somewhere?

Emile Silvis <emile@...>
 

I'm trying to do a basic post, and failing (caveat: I'm new to programming). Thanks.


Re: uploaded pictures are in a bad shape

Fernando Usero <fusero@...>
 

Finally solution was switching from Rest-client to NET::HTTP


On Tue, Dec 11, 2012 at 5:01 AM, Charles S van der Linden <sqapro@...> wrote:

I might suggest you consider sending the traffic through something like fiddler or wire shark, that allows you to see exactly what got sent.

On Dec 10, 2012 1:07 PM, "Fernando Usero" <fusero@...> wrote:
Hi Lennon, thanks for your hint. It didn't work. I got this error using your approach:

RestClient::ServerBrokeConnection: Server broke connection:
    from /home/fusero/.rvm/gems/ruby-1.9.2-p320@xserver/gems/rest-client-1.6.7/lib/restclient/request.rb:182:in `rescue in transmit'
    from /home/fusero/.rvm/gems/ruby-1.9.2-p320@xserver/gems/rest-client-1.6.7/lib/restclient/request.rb:140:in `transmit'
    from /home/fusero/.rvm/gems/ruby-1.9.2-p320@xserver/gems/rest-client-1.6.7/lib/restclient/request.rb:64:in `execute'
    from /home/fusero/.rvm/gems/ruby-1.9.2-p320@xserver/gems/rest-client-1.6.7/lib/restclient/request.rb:33:in `execute'
    from /home/fusero/.rvm/gems/ruby-1.9.2-p320@xserver/gems/rest-client-1.6.7/lib/restclient.rb:72:in `post'
    from (irb):167:in `block in irb_binding'

BTW, first thing after fixing this I will handle the file descriptors that are left open.....

any idea?


On Mon, Dec 10, 2012 at 12:51 AM, Lennon Day-Reynolds <rcoder@...> wrote:
I think your problem here is using the form encoding of the payload, not anything related to the content type or use of IO vs. File.

What happens if you try something like the version below? (I would try it myself, but I don't actually use/have access to Parse.)

---
open('yo.jpg') do |fh|
RestClient.post(
'https://api.parse.com/1/files/yo.jpg', fh,
{ :content_type => 'image/jpeg', :'X-Parse-Application-Id' => '…', :'X-Parse-REST-API-Key' => '…' }
)
end
---

From my reading of the current RestClient source, it looks like the above (passing the payload as a string, rather than a hash of form field values) should directly pass the raw image data, instead of encoding it as an HTML form. (Also, note the block form of opening the file; your version would leak open file handles if it ran in a persistent context like a Rails controller, due to never closing the opened File instance.)

<api-design-rant>As an aside: WTF is up with using a POST to a fixed resource URL as a means to do a file upload? Parse supports PUT elsewhere in their API, and that seems like a strictly better approach to use here, as well.</api-design-rant>

Hope that helps,

Lennon

--
Lennon Day-Reynolds
rcoder@... // @rcoder


On Sunday, December 9, 2012 at 3:02 PM, Fernando Usero wrote:

> Hi guys,
>
> I am having a really weird beahaviour and I am bit frustrated with this because I cannot see what more to test.
>
> I am uploading a jpg pic to parse.com (http://parse.com) and when downloading it, it never never is recognized as a jpg file. It seems to be the jpg file with some text placed at the beginning:
>
> <<<<
> --704472
> Content-Disposition: form-data; name="upload[file]"; filename="yo.jpg"
> Content-Type: image/jpeg
> > > >
> > >
> >
>
>
> I am using this restclient command:
>
> <<<<
> RestClient.post 'https://api.parse.com/1/files/yo.jpg',
> { :upload => { :file =>File.new('yo.jpg') } },
> { :content_type => "image/jpg", :"X-Parse-Application-Id" => XXXX, :"X-Parse-REST-API-Key"=> YYYY }
> > > > >
> > > >
> > >
> >
>
> However using the translation to curl it works smoothly and the jog file can be downloaded again:
>
> <<<<
> curl -X POST -H "X-Parse-Application-Id: XXXX" -H "X-Parse-REST-API-Key: YYYY" -H "Content-Type: image/jpeg" --data-binary '@yo.jpg' https://api.parse.com/1/files/yo.jpg
> > > > >
> > > >
> > >
> >
>
>
> i tried several things:
>
> - Trying to use IO.read instead of File.new (read in this mailing list)
> - Tryin to change to content-type tp image/jpg instead of image/jpg
> - Trying to set multipart => true and false
>
> Any hint? Any clue?





Re: uploaded pictures are in a bad shape

Charles S van der Linden <sqapro@...>
 

I might suggest you consider sending the traffic through something like fiddler or wire shark, that allows you to see exactly what got sent.

On Dec 10, 2012 1:07 PM, "Fernando Usero" <fusero@...> wrote:

Hi Lennon, thanks for your hint. It didn't work. I got this error using your approach:

RestClient::ServerBrokeConnection: Server broke connection:
    from /home/fusero/.rvm/gems/ruby-1.9.2-p320@xserver/gems/rest-client-1.6.7/lib/restclient/request.rb:182:in `rescue in transmit'
    from /home/fusero/.rvm/gems/ruby-1.9.2-p320@xserver/gems/rest-client-1.6.7/lib/restclient/request.rb:140:in `transmit'
    from /home/fusero/.rvm/gems/ruby-1.9.2-p320@xserver/gems/rest-client-1.6.7/lib/restclient/request.rb:64:in `execute'
    from /home/fusero/.rvm/gems/ruby-1.9.2-p320@xserver/gems/rest-client-1.6.7/lib/restclient/request.rb:33:in `execute'
    from /home/fusero/.rvm/gems/ruby-1.9.2-p320@xserver/gems/rest-client-1.6.7/lib/restclient.rb:72:in `post'
    from (irb):167:in `block in irb_binding'

BTW, first thing after fixing this I will handle the file descriptors that are left open.....

any idea?


On Mon, Dec 10, 2012 at 12:51 AM, Lennon Day-Reynolds <rcoder@...> wrote:
I think your problem here is using the form encoding of the payload, not anything related to the content type or use of IO vs. File.

What happens if you try something like the version below? (I would try it myself, but I don't actually use/have access to Parse.)

---
open('yo.jpg') do |fh|
RestClient.post(
'https://api.parse.com/1/files/yo.jpg', fh,
{ :content_type => 'image/jpeg', :'X-Parse-Application-Id' => '…', :'X-Parse-REST-API-Key' => '…' }
)
end
---

From my reading of the current RestClient source, it looks like the above (passing the payload as a string, rather than a hash of form field values) should directly pass the raw image data, instead of encoding it as an HTML form. (Also, note the block form of opening the file; your version would leak open file handles if it ran in a persistent context like a Rails controller, due to never closing the opened File instance.)

<api-design-rant>As an aside: WTF is up with using a POST to a fixed resource URL as a means to do a file upload? Parse supports PUT elsewhere in their API, and that seems like a strictly better approach to use here, as well.</api-design-rant>

Hope that helps,

Lennon

--
Lennon Day-Reynolds
rcoder@... // @rcoder


On Sunday, December 9, 2012 at 3:02 PM, Fernando Usero wrote:

> Hi guys,
>
> I am having a really weird beahaviour and I am bit frustrated with this because I cannot see what more to test.
>
> I am uploading a jpg pic to parse.com (http://parse.com) and when downloading it, it never never is recognized as a jpg file. It seems to be the jpg file with some text placed at the beginning:
>
> <<<<
> --704472
> Content-Disposition: form-data; name="upload[file]"; filename="yo.jpg"
> Content-Type: image/jpeg
> > > >
> > >
> >
>
>
> I am using this restclient command:
>
> <<<<
> RestClient.post 'https://api.parse.com/1/files/yo.jpg',
> { :upload => { :file =>File.new('yo.jpg') } },
> { :content_type => "image/jpg", :"X-Parse-Application-Id" => XXXX, :"X-Parse-REST-API-Key"=> YYYY }
> > > > >
> > > >
> > >
> >
>
> However using the translation to curl it works smoothly and the jog file can be downloaded again:
>
> <<<<
> curl -X POST -H "X-Parse-Application-Id: XXXX" -H "X-Parse-REST-API-Key: YYYY" -H "Content-Type: image/jpeg" --data-binary '@yo.jpg' https://api.parse.com/1/files/yo.jpg
> > > > >
> > > >
> > >
> >
>
>
> i tried several things:
>
> - Trying to use IO.read instead of File.new (read in this mailing list)
> - Tryin to change to content-type tp image/jpg instead of image/jpg
> - Trying to set multipart => true and false
>
> Any hint? Any clue?




Re: uploaded pictures are in a bad shape

Fernando Usero <fusero@...>
 

Hi Lennon, thanks for your hint. It didn't work. I got this error using your approach:

RestClient::ServerBrokeConnection: Server broke connection:
    from /home/fusero/.rvm/gems/ruby-1.9.2-p320@xserver/gems/rest-client-1.6.7/lib/restclient/request.rb:182:in `rescue in transmit'
    from /home/fusero/.rvm/gems/ruby-1.9.2-p320@xserver/gems/rest-client-1.6.7/lib/restclient/request.rb:140:in `transmit'
    from /home/fusero/.rvm/gems/ruby-1.9.2-p320@xserver/gems/rest-client-1.6.7/lib/restclient/request.rb:64:in `execute'
    from /home/fusero/.rvm/gems/ruby-1.9.2-p320@xserver/gems/rest-client-1.6.7/lib/restclient/request.rb:33:in `execute'
    from /home/fusero/.rvm/gems/ruby-1.9.2-p320@xserver/gems/rest-client-1.6.7/lib/restclient.rb:72:in `post'
    from (irb):167:in `block in irb_binding'

BTW, first thing after fixing this I will handle the file descriptors that are left open.....

any idea?


On Mon, Dec 10, 2012 at 12:51 AM, Lennon Day-Reynolds <rcoder@...> wrote:

I think your problem here is using the form encoding of the payload, not anything related to the content type or use of IO vs. File.

What happens if you try something like the version below? (I would try it myself, but I don't actually use/have access to Parse.)

---
open('yo.jpg') do |fh|
RestClient.post(
'https://api.parse.com/1/files/yo.jpg', fh,
{ :content_type => 'image/jpeg', :'X-Parse-Application-Id' => '…', :'X-Parse-REST-API-Key' => '…' }
)
end
---

From my reading of the current RestClient source, it looks like the above (passing the payload as a string, rather than a hash of form field values) should directly pass the raw image data, instead of encoding it as an HTML form. (Also, note the block form of opening the file; your version would leak open file handles if it ran in a persistent context like a Rails controller, due to never closing the opened File instance.)

<api-design-rant>As an aside: WTF is up with using a POST to a fixed resource URL as a means to do a file upload? Parse supports PUT elsewhere in their API, and that seems like a strictly better approach to use here, as well.</api-design-rant>

Hope that helps,

Lennon

--
Lennon Day-Reynolds
rcoder@... // @rcoder


On Sunday, December 9, 2012 at 3:02 PM, Fernando Usero wrote:

> Hi guys,
>
> I am having a really weird beahaviour and I am bit frustrated with this because I cannot see what more to test.
>
> I am uploading a jpg pic to parse.com (http://parse.com) and when downloading it, it never never is recognized as a jpg file. It seems to be the jpg file with some text placed at the beginning:
>
> <<<<
> --704472
> Content-Disposition: form-data; name="upload[file]"; filename="yo.jpg"
> Content-Type: image/jpeg
> > > >
> > >
> >
>
>
> I am using this restclient command:
>
> <<<<
> RestClient.post 'https://api.parse.com/1/files/yo.jpg',
> { :upload => { :file =>File.new('yo.jpg') } },
> { :content_type => "image/jpg", :"X-Parse-Application-Id" => XXXX, :"X-Parse-REST-API-Key"=> YYYY }
> > > > >
> > > >
> > >
> >
>
> However using the translation to curl it works smoothly and the jog file can be downloaded again:
>
> <<<<
> curl -X POST -H "X-Parse-Application-Id: XXXX" -H "X-Parse-REST-API-Key: YYYY" -H "Content-Type: image/jpeg" --data-binary '@yo.jpg' https://api.parse.com/1/files/yo.jpg
> > > > >
> > > >
> > >
> >
>
>
> i tried several things:
>
> - Trying to use IO.read instead of File.new (read in this mailing list)
> - Tryin to change to content-type tp image/jpg instead of image/jpg
> - Trying to set multipart => true and false
>
> Any hint? Any clue?




Re: uploaded pictures are in a bad shape

Lennon Day-Reynolds <rcoder@...>
 

I think your problem here is using the form encoding of the payload, not anything related to the content type or use of IO vs. File.

What happens if you try something like the version below? (I would try it myself, but I don't actually use/have access to Parse.)

---
open('yo.jpg') do |fh|
RestClient.post(
'https://api.parse.com/1/files/yo.jpg', fh,
{ :content_type => 'image/jpeg', :'X-Parse-Application-Id' => '…', :'X-Parse-REST-API-Key' => '…' }
)
end
---

From my reading of the current RestClient source, it looks like the above (passing the payload as a string, rather than a hash of form field values) should directly pass the raw image data, instead of encoding it as an HTML form. (Also, note the block form of opening the file; your version would leak open file handles if it ran in a persistent context like a Rails controller, due to never closing the opened File instance.)

<api-design-rant>As an aside: WTF is up with using a POST to a fixed resource URL as a means to do a file upload? Parse supports PUT elsewhere in their API, and that seems like a strictly better approach to use here, as well.</api-design-rant>

Hope that helps,

Lennon

--
Lennon Day-Reynolds
rcoder@... // @rcoder

On Sunday, December 9, 2012 at 3:02 PM, Fernando Usero wrote:

Hi guys,

I am having a really weird beahaviour and I am bit frustrated with this because I cannot see what more to test.

I am uploading a jpg pic to parse.com (http://parse.com) and when downloading it, it never never is recognized as a jpg file. It seems to be the jpg file with some text placed at the beginning:

<<<<
--704472
Content-Disposition: form-data; name="upload[file]"; filename="yo.jpg"
Content-Type: image/jpeg

I am using this restclient command:

<<<<
RestClient.post 'https://api.parse.com/1/files/yo.jpg',
{ :upload => { :file =>File.new('yo.jpg') } },
{ :content_type => "image/jpg", :"X-Parse-Application-Id" => XXXX, :"X-Parse-REST-API-Key"=> YYYY }
However using the translation to curl it works smoothly and the jog file can be downloaded again:

<<<<
curl -X POST -H "X-Parse-Application-Id: XXXX" -H "X-Parse-REST-API-Key: YYYY" -H "Content-Type: image/jpeg" --data-binary '@yo.jpg' https://api.parse.com/1/files/yo.jpg

i tried several things:

- Trying to use IO.read instead of File.new (read in this mailing list)
- Tryin to change to content-type tp image/jpg instead of image/jpg
- Trying to set multipart => true and false

Any hint? Any clue?


uploaded pictures are in a bad shape

Fernando Usero <fusero@...>
 

Hi guys,

I am having a really weird beahaviour and I am bit frustrated with this because I cannot see what more to test.

I am uploading a jpg pic to parse.com and when downloading it, it never never is recognized as a jpg file. It seems to be the jpg file with some text placed at the beginning:

<<<<
--704472
Content-Disposition: form-data; name="upload[file]"; filename="yo.jpg"
Content-Type: image/jpeg
>>>>

I am using this restclient command:

<<<<
RestClient.post 'https://api.parse.com/1/files/yo.jpg',
{ :upload => { :file =>File.new('yo.jpg') } },
{ :content_type => "image/jpg", :"X-Parse-Application-Id" => XXXX, :"X-Parse-REST-API-Key"=> YYYY }
>>>>>
However using the translation to curl it works smoothly and the jog file can be downloaded again:

<<<<
curl -X POST -H "X-Parse-Application-Id: XXXX"  -H "X-Parse-REST-API-Key: YYYY" -H "Content-Type: image/jpeg" --data-binary '@yo.jpg' https://api.parse.com/1/files/yo.jpg
>>>>>

i tried several things:

- Trying to use IO.read instead of File.new (read in this mailing list)
- Tryin to change to content-type tp image/jpg instead of image/jpg
- Trying to set multipart => true and false

Any hint? Any clue?


GET with deep parameters

Jack Repenning <jrepenning@...>
 

rest-client (1.6.7)

I need to pass a multi-level hash in as parameters to a GET call. I see a discussion about this in the archives already,

http://librelist.com/browser//rest.client/2010/7/24/rest-client-passing-parameters-on-get-request/#a5a6253f3d005bcb28f836fe4b5b24eb

but that solution only seems to work a level or two deep; below that, the Hash remains stringified. Am I doing something wrong?

Some details:

credentials = {
:developerOrganization => "jreptest",
:developerKey => "1c9e3deaffd264823e553935bbf238117ff2f88d",
:domain => "jreptest",
:login => "jreptest",
:password => "password"
}
RestClient.get url, {:params => {:credentials => credentials}}

is logged by Rails as

Parameters: {"credentials"=>"{:developerOrganization=>\"jreptest\", :developerKey=>\"1c9e3deaffd264823e553935bbf238117ff2f88d\", :domain=>\"jreptest\", :login=>\"jreptest\", :password=>\"password\"}", "id"=>"102"}

Notice the quoting: the hash whose first key is :developerOrganization is still stringified.

In contrast, this works (but makes me feel dirty ;-):

# Monkey-patch RestClient to define get_with_payload
module RestClient
def self.get_with_payload(url, payload, headers={}, &block)
Request.execute(:method => :get, :url => url, :payload => payload, :headers => headers, &block)
end
end
RestClient.get_with_payload url, :credentials => credentials



-==-
Jack Repenning
Technologist
CollabNet, Inc.
8000 Marina Blvd., Suite 600
Brisbane, CA 94005
O: 650.228.2562 | F: 650.228.2501 | Skype: JackRepenning
E: jrepenning@...

www.collab.net

Enterprise Cloud Development
10,000 customers, 3.6M users, 1M paid subscribers


Syntax for passing the content of a file to a post request using rest-client

Carlos Araya <carlos.araya@...>
 

I have the following code in the file lib/validator.rb

#!/usr/bin/env ruby -d
require 'json'
require 'rest_client'

module Ctools
class Validator
# Based on the code from
https://github.com/damian/html5_validator/blob/master/lib/html5_validator.rb

attr_reader :errors
BASE_URI = 'http://html5.validator.nu'
HEADERS = { 'Content-Type' => 'text/html; charset=utf-8',
'Content-Encoding' => 'UTF-8' }

def initialize(proxy = nil)
RestClient.proxy = proxy unless proxy.nil?
@errors = []
end

# Validate the markup of a String
def check_content(text)
response = RestClient.post "#{BASE_URI}/?out=json", text, HEADERS
@json = JSON.parse(response.body)
@errors = retrieve_errors
end

# Validate the markup of a URI
def check_uri(uri)
response = RestClient.get BASE_URI, :params => { :doc => uri,
:out => 'json' }
@json = JSON.parse(response.body)
@errors = retrieve_errors
end

def inspect
@errors.map do |err|
"- Error: #{err['message']}"
end.join("\n")
end

def valid?
@errors.length == 0
end

private

def retrieve_errors
@json['messages'].select { |mssg| mssg['type'] == 'error' }
end
end #class
end # module


The code is called from validator_test.rb as follows:


#!/usr/local/bin/ruby -d

require_relative '../lib/ctools/validator.rb'

# p $LOAD_PATH
@html = File.new('/Users/carlos/experiment/code/ctools/test/index.html').read
# p @html
check = Ctools::Validator.new
check.check_content(@html)

but I get the following output:

rivendell:ctools carlos$ bin/validate_test.rb
Using c extension for JSON.
Exception `LoadError' at <internal:lib/rubygems/custom_require>:29 -
no such file to load -- rest_client
Type multipart/x-parallel already registered as a variant of multipart/parallel.
Type text/plain already registered as a variant of text/plain.
/usr/local/lib/ruby/gems/1.9.1/gems/rest-client-1.6.7/lib/restclient/response.rb:11:
warning: method redefined; discarding old body
/usr/local/lib/ruby/gems/1.9.1/gems/rest-client-1.6.7/lib/restclient/payload.rb:47:
warning: mismatched indentations at 'end' with 'case' at 40
Exception `Errno::EAGAIN' at
/usr/local/lib/ruby/1.9.1/net/protocol.rb:135 - Resource temporarily
unavailable - read would block
Exception `Errno::EAGAIN' at
/usr/local/lib/ruby/1.9.1/net/protocol.rb:135 - Resource temporarily
unavailable - read would block

Is this a problem with rest_client or with the way I'm calling it in my code?

Carlos


Important pull-requests

Endel Dreyer <endel.dreyer@...>
 

Hey guys, 

I've merged the important pull-requests into my fork:

Some tests isn't passing yet. I'll fix it ASAP.

PS: Julien Kirch, if you're too busy or not interested anymore on this project,
I'm asking you to add me as maintainer. 

Best regards,

Endel Dreyer


Multipart request with different Content-Types

Peter Spierenburg <peter.spierenburg@...>
 

Greetings,

I'm trying to create a request whose overall Content-Type is multipart/form-data and whose parts are text/plain and application/octet-stream. How do I specify the Content-Types of each of the parts?

Thanks,

Peter.


Multipart requests with different Content-Types.

Peter Spierenburg <peter.spierenburg@...>
 

Greetings,

I am trying to invoke a PUT method on a REST service that requires multipart/form-data where one of the parts must be text/plain, and the others are application/octet-stream. None of the parameters exist on the filesystem, so I cannot use your auto-detect feature. Is there a way to assign content-types to the parts of a request?

Thanks.


Re: RestClient and SSL stores/default paths

David Ljung Madison <librelist.com@...>
 

Actually, unless you're doing mutual SSL authentication with the
server, you should not pass an :ssl_client_cert option. Is your
server live somewhere so that we can test?
Unfortunately it's a work server for a startup, so not really.

I don't think I need mutual SSL authentication. This is a site
that works just fine with a browser, so it seems to figure it out.

I take it the :ssl_client_cert option is for the server's cert that I'm connecting to, and I don't need that?

Regardless, I've tried it with:

rc = RestClient::Resource.new(
url,
:timeout => 200,
:ssl_ca_file => "/etc/ssl/certs/Go_Daddy_Class_2_CA.pem",
:verify_ssl => OpenSSL::SSL::VERIFY_PEER
)


And it doesn't work:

SSL Verification failed -- Preverify: false, Error: unable to get issuer certificate (2)

What do I need to do with RestClient to get it to act like the
browser or like Net::HTTP using the default store?



Dave

---------------------------------------------------------------------------
Dave Ljung Madison http://GetDave.com/ 415.341.5555
--- "Debugging is twice as hard as writing the code in the first place. ---
Therefore, if you write the code as cleverly as possible, you are,
by definition, not smart enough to debug it." - Brian W. Kernighan

21 - 40 of 314