Sha256: 0c4100ada3b47cd53af5ff0073c3b0e30f8446a867f95f07a7ed7358820879ed

Contents?: true

Size: 432 Bytes

Versions: 3

Compression:

Stored size: 432 Bytes

Contents

module Falconz
  module REST
    module POST 
      def post_request(path, json: false, **options)
        response = HTTParty.post(url + path, 
                                headers: header,
                                body: options)
        if response.success?
          return response.body if json
          return response
        else
          raise RuntimeError, response.to_h
        end
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
falconz-1.1.1 lib/falconz/rest/post.rb
falconz-1.1.0 lib/falconz/rest/post.rb
falconz-1.0.2 lib/falconz/rest/post.rb