Sha256: 9ed1498b17cb285983da581a5d52f1cc9e18dbb7a8dce5d36d3e26c18fc5b548

Contents?: true

Size: 415 Bytes

Versions: 8

Compression:

Stored size: 415 Bytes

Contents

# frozen_string_literal: true

module Monday
  # Defines the HTTP request methods.
  class Request
    # Performs a POST request
    def self.post(uri, query, headers)
      http = Net::HTTP.new(uri.host, uri.port)
      http.use_ssl = true
      request = Net::HTTP::Post.new(uri.request_uri, headers)

      request.body = {
        "query" => query
      }.to_json

      http.request(request)
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
monday_ruby-1.0.0 lib/monday/request.rb
monday_ruby-0.6.2 lib/monday/request.rb
monday_ruby-0.6.1 lib/monday/request.rb
monday_ruby-0.6.0 lib/monday/request.rb
monday_ruby-0.4.0 lib/monday/request.rb
monday_ruby-0.3.0 lib/monday/request.rb
monday_ruby-0.2.0 lib/monday/request.rb
monday_ruby-0.1.0 lib/monday/request.rb