Method: XStreamly::Client#usageMessages
- Defined in:
- lib/xstreamly.rb
#usageMessages ⇒ Object
172 173 174 175 176 177 178 179 180 181 182 183 |
# File 'lib/xstreamly.rb', line 172 def usageMessages() req = Net::HTTP::Get.new(URI.encode('/usage/messages'), initheader = {'Content-Type' =>'application/json'}) req.basic_auth @email, @password response = @http.request(req) case response.code.to_i when 200..299 return (JSON(response.body))['data'] else raise RuntimeError, "Unknown error (status code #{response.code} ): #{response.body}" end end |