module Qiitan::API::Items

Public Instance Methods

delete() click to toggle source
# File lib/qiitan/api/items.rb, line 18
def delete
        url = "#{API_BASE_URL}items/#{uuid}?token=#{@token}"
        res = Qiitan::HTTP.request(url, :delete, true)
end
get_newly_post() click to toggle source
# File lib/qiitan/api/items.rb, line 23
def get_newly_post
        url = "#{API_BASE_URL}items?token=#{@token}"
        res = Qiitan::HTTP.request(url, :get, true)

        JSON.parse res.body
end
post(payload) click to toggle source

Args

Hash

# File lib/qiitan/api/items.rb, line 8
def post(payload)
        url = "#{API_BASE_URL}items?token=#{@token}"
        res = Qiitan::HTTP.request(url, :post, true) do |req|
                req['Content-Type'] = 'application/json'
                req.body = payload
        end

        JSON.parse res.body
end