Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to set the port in HTTParty

Tags:

ruby

ssl

httparty

I read that HTTParty uses SSL if the port is set to 443, but I don't see how to set the port. Can someone clarify this for me?

like image 504
JellicleCat Avatar asked Oct 29 '12 15:10

JellicleCat


1 Answers

Check the specs:

https://github.com/jnunemaker/httparty/blob/82a90c1b93b076f9d2d7410123c2b5d609401a1f/spec/httparty/request_spec.rb#L41

The target URL is expected to use port 443. Just adding the :443 at the end of the target URI should be enough to make HTTParty use SSL.

By the way, HTTPS URLs will use SSL too.

Examples:

http://foo.com     => no SSL
https://foo.com    => SSL
http://foo.com:443 => SSL
like image 81
robertodecurnex Avatar answered Sep 19 '22 09:09

robertodecurnex