Ruby on Rails Wednesday, May 31, 2017

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:

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.

On May 31, 2017, at 1:39 PM, Joe Guerra <> wrote:

Ok, I'll try the gem.

How about passing the parameters in the url?  and opening up the canada post site with that?


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 <> 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:

Hassan Schroeder ------------------------
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
To post to this group, send email to
To view this discussion on the web visit
For more options, visit

If you'd like to reply by encrypted email you can find my public key on (more about setting GPG:

No comments:

Post a Comment