On Friday, 25 May 2012 06:38:04 UTC-4, iDev wrote:>
> Hi all
>
> I''m getting a ''Connection reset by peer'' while
getting an access token during oAuth from a third party API. Here''s the
code snippet:
>
> def accesstoken
> @code = params[:code]
>
> url = URI.parse(''access token request url'')
> req = Net::HTTP::Post.new(url.path)
> req.set_form_data({''auth_code'' => @code,
''client_id''=>''my_client_id'',
''client_secret''=>''my_secret_key''},
'';'')
>
>
Is there some particular reason you''re using the semicolon separator
here?
Unless you''ve got a very weird server on the other end, the default
separator for set_form_data (&) is almost certainly the correct thing to
use.
Also note that, given that you''re sending client_secret, you should be
using SSL for this connection as well - see my reply to your earlier post.
--Matt Jones
--
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/rubyonrails-talk/-/41nzUvQIAh4J.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.