Class: RestClient

Inherits:
Object
  • Object
show all
Defined in:
lib/shoutout/restclient.rb

Class Method Summary collapse

Class Method Details

.postJson(apikey:, body:, url:) ⇒ Object

# Send the request

    response = http.request(request)
    puts response.body
    return response
end


23
24
25
26
27
28
29
30
# File 'lib/shoutout/restclient.rb', line 23

def self.postJson(apikey:,body:,url:)
    response = HTTP.auth("Apikey #{apikey}").post(url, 
                :json => body
            )
          
            return JSON.parse(response.to_s)

end