<commit_before>require 'net/http'

module VoicecomSms
  class Request
    attr_accessor :uri, :params
    attr_reader :raw_response, :error

    def initialize
      @uri = URI.parse('http://' + VoicecomSms.config.provider_ip + '/' + VoicecomSms.config.send_req_path)
      @params = {}
      @raw_response = nil
      @error = nil
    end

    def params=(query_params)
      @params = query_params
      @uri.query = URI.encode_www_form(@params)
    end

    def send_message
      @raw_response = Net::HTTP.get_response(@uri)
    rescue Exception => e
      @error = e.message
    end

    def sent?
      @error.nil? && @raw_response.present?
    end

    def to_s
      @uri.to_s
    end
  end
end
<commit_msg>request should use ssl<commit_after>require 'net/http'

module VoicecomSms
  class Request
    attr_accessor :uri, :params
    attr_reader :raw_response, :error

    def initialize
      @uri = URI.parse('https://' + VoicecomSms.config.provider_ip + ':8443/' + VoicecomSms.config.send_req_path)
      @params = {}
      @raw_response = nil
      @error = nil
    end

    def params=(query_params)
      @params = query_params
      @uri.query = URI.encode_www_form(@params)
    end

    def send_message
      https = Net::HTTP.new(@uri.host, @uri.port)
      https.use_ssl = true
      https.verify_mode = OpenSSL::SSL::VERIFY_NONE # you may put here VERIFY_PEER instead, but make sure to load the provider's certificate (more: http://martinottenwaelter.fr/2010/12/ruby19-and-the-ssl-error/)

      request = Net::HTTP::Get.new(@uri.path)
      request.set_form_data(@params)

      @raw_response = https.request(@uri.path)
    rescue Exception => e
      @error = e.message
    end

    def sent?
      @error.nil? && @raw_response.present?
    end

    def to_s
      @uri.to_s
    end
  end
end

{'fraction_non_alphanumeric': 0.1118457300275482, 'fraction_numerical': 0.006611570247933884, 'mean_word_length': 2.653923541247485, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 1, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6059224', 'n_tokens_mistral': 627, 'n_tokens_neox': 605, 'n_words': 134}