title: Can the httr package make HTTPS calls?
body: <p>Code that previously worked now throws an error due to the server requesting HTTPS calls and no longer accepts HTTP.</p>
  <p>Can this code me modified to work? Or is a new process required for encrypted HTTPS?</p>
  <p>Thank you!</p>
  <pre><code># Connecting to EIA API
  
  # install.packages(c(&quot;httr&quot;, &quot;jsonlite&quot;))
  
  library(httr)
  library(jsonlite)
  
  key &lt;- &quot;e77e9bd3c8bc84927fad13088f4bff28&quot;
  
  padd_key &lt;- list('PET.MCRRIP12.M','PET.MCRRIP22.M',
                   'PET.MCRRIP32.M','PET.MCRRIP42.M',
                   'PET.MCRRIP52.M')
  startdate &lt;- &quot;2010-01-01&quot; #YYYY-MM-DD
  enddate &lt;- &quot;2022-02-13&quot; #YYYY-MM-DD
  
  j = 0
  for (i in padd_key) {
    
    url &lt;- paste('http://api.eia.gov/series/?api_key=',key,'&amp;series_id=',i,sep=&quot;&quot;)
    
    res &lt;- GET(url)
    
    json_data &lt;- fromJSON(rawToChar(res$content))
    data &lt;- data.frame(json_data$series$data)
    data$Year &lt;- substr(data$X1,1,4)
    data$Month &lt;- substr(data$X1,5,6)
    data$Day &lt;- 1
    
    data$Date &lt;- as.Date(paste(data$Year, data$Month, data$Day, sep='-'))
    colnames(data)[2]  &lt;- json_data$series$name
    data &lt;- data[-c(1,3,4,5)]
    
    if (j == 0){
      data_final &lt;- data
    }
    else{
      data_final &lt;- merge(data_final,data,by=&quot;Date&quot;)
    }
    
    j = j + 1
  }
  
  data_final &lt;- subset(data_final, Date &gt;= startdate &amp; Date &lt;= enddate)
  </code></pre>