Sha256: 82ddee51bbf9960c50176feb8636de5076819f2f8d9628c62b01022742115e5b

Contents?: true

Size: 730 Bytes

Versions: 1

Compression:

Stored size: 730 Bytes

Contents

# frozen_string_literal: true

require_relative "dock_qa_test/version"

module QasDockGem
  class RequestsAPI
    require 'httparty'
    require 'logger'
  
    def execute_post(token, uri, payload, headers)
      logger = Logger.new(STDOUT)
      logger.info("Realizando POST")
      logger.info("Token: #{token}")
      logger.info("URI: #{uri}")
      logger.info("Payload: #{payload}")
      logger.info("Headers: #{headers}")
      params = {
        :headers => {'cache-control': 'no-cache','content-type': 'application/json'},
        :body => payload.to_json
      }
      response = HTTParty.post(uri, params)
      logger.info("POST realizado")
      logger.info("Response: #{response}")
      response
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
qas_dock_gem-0.1.2 lib/qas_dock_gem.rb