Sha256: b9b595fa0b9b24b9d24153bf353c743be68d1fcf200a45a8c56ace1d50abe887

Contents?: true

Size: 666 Bytes

Versions: 2

Compression:

Stored size: 666 Bytes

Contents

# frozen_string_literal: true

require_relative "dock_qa_test/version"

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

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
qas_dock_gem-0.1.1 lib/qas_dock_gem.rb
qas_dock_gem-0.1.0 lib/qas_dock_gem.rb