Hassan is correctly encouraging you towards the higher-level abstractions, like 
a Gem specifically written for this purpose.

If you really want to know how to make outgoing http requests, the answer is 
the Net::HTTP Ruby library, which is documented here:

https://docs.ruby-lang.org/en/2.0.0/Net/HTTP.html

But as Hassan said if there's a higher level abstraction, like a Gem, prefer 
that to writing your own low-level code.

But as a ruby developer the Net::HTTP Ruby library is at the very least 
something you should learn about and play around with, even if you don't 
actually need it for this immediate purpose.
-Jason



> On May 31, 2017, at 1:39 PM, Joe Guerra <jgue...@jginfosys.com> wrote:
> 
> Ok, I'll try the gem.
> 
> How about passing the parameters in the url?  and opening up the canada post 
> site with that?
> 
> Thanks,
> Joe
> 
> On Wednesday, May 31, 2017 at 1:36:20 PM UTC-4, Hassan Schroeder wrote:
> On Wed, May 31, 2017 at 10:27 AM, Joe Guerra <jgu...@jginfosys.com 
> <javascript:>> wrote: 
> > Hmm, which gem would allow you to perform http requests within Rails?  I 
> > would like to send a request to the canadapost website and pass it some 
> > parameters and return a shipping total. 
> > 
> > I do believe there is a canadapost gem, but I'm not sure how upto date it 
> > is. 
> 
> Searching for `ruby gem canada post` turns up more than one -- why 
> don't you just try them and see which you prefer? 
> 
> Similarly `ruby gem http` will show you some possibilities if you want 
> to roll your own solution. See also: 
> https://ruby-doc.org/stdlib-2.4.1/libdoc/net/http/rdoc/index.html 
> <https://ruby-doc.org/stdlib-2.4.1/libdoc/net/http/rdoc/index.html> 
> 
> HTH! 
> -- 
> Hassan Schroeder ------------------------ hassan.s...@gmail.com <javascript:> 
> twitter: @hassan 
> Consulting Availability : Silicon Valley or remote 
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Ruby on Rails: Talk" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to rubyonrails-talk+unsubscr...@googlegroups.com 
> <mailto:rubyonrails-talk+unsubscr...@googlegroups.com>.
> To post to this group, send email to rubyonrails-talk@googlegroups.com 
> <mailto:rubyonrails-talk@googlegroups.com>.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/rubyonrails-talk/80f27a88-f7ca-4bc8-a66c-380da41a4ccf%40googlegroups.com
>  
> <https://groups.google.com/d/msgid/rubyonrails-talk/80f27a88-f7ca-4bc8-a66c-380da41a4ccf%40googlegroups.com?utm_medium=email&utm_source=footer>.
> For more options, visit https://groups.google.com/d/optout 
> <https://groups.google.com/d/optout>.

----

Jason Fleetwood-Boldt
t...@datatravels.com
http://www.jasonfleetwoodboldt.com/writing

If you'd like to reply by encrypted email you can find my public key on 
jasonfleetwoodboldt.com <http://jasonfleetwoodboldt.com/> (more about setting 
GPG: https://gpgtools.org) 

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to rubyonrails-talk+unsubscr...@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rubyonrails-talk/40BBA1BD-B10F-4D38-8C58-534574700D75%40datatravels.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to