lib/firstclasspostcodes/configuration.rb
# Defines API keys used with API Key authentications.
#
# @return [String] the value of the API key being used
#
# @example parameter name is "api_key", API key is "xxx"
#   config.api_key['api_key'] = 'xxx'
Defines API keys used with API Key authentications.
Defines API keys used with API Key authentications .
def to_request_params
      params = {
        headers: {
          'x-api-key': api_key,
          accept: "application/#{content}; q=1.0, application/json; q=0.5",
        },
        timeout: timeout,
        ssl_verifypeer: verify_ssl,
        ssl_verifyhost: verify_ssl_host ? 2 : 0,
        sslcert: cert_file,
        sslkey: key_file,
        verbose: debug,
      }
      params[:cainfo] = ssl_ca_cert if ssl_ca_cert
      params
    end
def to_request_params params = { headers : { 'x-api-key' : api_key , accept : "application/#{content}; q=1.0, application/json; q=0.5" , } , timeout : timeout , ssl_verifypeer : verify_ssl , ssl_verifyhost : verify_ssl_host ? 2 : 0 , sslcert : cert_file , sslkey : key_file , verbose : debug , } params [ :cainfo ] = ssl_ca_cert if ssl_ca_cert params end
Defines API keys used with API Key authentications.
Defines API keys used with API Key authentications .
the value of the API key being used
the value of the API key being used
String
example
parameter name is "api_key", API key is "xxx" config.api_key['api_key'] = 'xxx'
parameter name is " api_key " API key is " xxx " config . api_key [ ' api_key ' ] = ' xxx '