Class: ComprodlsSdkCore

Inherits:
Object
  • Object
show all
Defined in:
lib/comprodls-sdk-core.rb

Class Method Summary collapse

Class Method Details

.postRequest(url, path) ⇒ Object



6
7
8
9
10
11
12
13
14
# File 'lib/comprodls-sdk-core.rb', line 6

def self.postRequest(url, path)
  uri = URI.parse(url)
  http = Net::HTTP.new(uri.host, uri.port)
  request = Net::HTTP::Post.new(path)
  request.add_field('Content-Type', 'application/json')
  request.body = {username: 'student11', password: 'Compro11'}.to_json
  response = http.request(request)
  response
end