# Get webpage body by HTTPS

**URL:** <https://www.ruby-forum.com/t/get-webpage-body-by-https/117176>\
**Category:** Rails\
**Created:** [October 14, 2007, 12:02pm UTC](https://www.ruby-forum.com/t/get-webpage-body-by-https/117176 "2007-10-14T12:02:05Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![esox\_ch](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/4da419/32.png) [@esox\_ch](https://www.ruby-forum.com/u/esox_ch)\
**Post date:** [October 14, 2007, 12:02pm UTC](https://www.ruby-forum.com/t/get-webpage-body-by-https/117176/1 "2007-10-14T12:02:05Z")

</div>

Hello,

I need to get the HTML content of a website which can be accessed by  
HTTPS.  
I tried to use

require ‘net/http’

uri=“[https://website.com](https://website.com)”  
url = URI.parse(uri)  
req = Net::HTTP::Get.new(url.path)  
https = Net::HTTP.new url.host, url.port  
https.use\_ssl true  
res = https.start {|http|  
http.request(req)  
}  
puts res.body

But I get an error saying that use\_ssl is not defined in class Net:HTTP  
(even if the documentation says other way).

Does anyone know what’s wrong?

Thanks

---

<div class="post-metadata">

**Author:** ![esox\_ch](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/4da419/32.png) [@esox\_ch](https://www.ruby-forum.com/u/esox_ch)\
**Post date:** [October 14, 2007, 3:00pm UTC](https://www.ruby-forum.com/t/get-webpage-body-by-https/117176/2 "2007-10-14T15:00:41Z")

</div>

Hi,

You need to include the ssl part as well.

Julian.
