class GdsApi::JsonClient
def with_auth_options(method_params)
Take a hash of parameters for Request#execute; return a hash of
def with_auth_options(method_params) if @options[:bearer_token] headers = method_params[:headers] || {} method_params.merge(headers: headers.merge( "Authorization" => "Bearer #{@options[:bearer_token]}", )) elsif @options[:basic_auth] method_params.merge( user: @options[:basic_auth][:user], password: @options[:basic_auth][:password], ) else method_params end end