# 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