Class: Camunda::OAuthResource

Inherits:
Object
  • Object
show all
Defined in:
lib/camunda/o_auth_resource.rb

Class Method Summary collapse

Class Method Details

.create_by_uri(uri:, payload:) ⇒ Object



5
6
7
8
9
10
11
12
13
14
15
# File 'lib/camunda/o_auth_resource.rb', line 5

def self.create_by_uri(uri:, payload:)
  headers = {
    'Content-Type': 'application/json'
  }

  response = RestClient.post(uri, payload.to_json, headers)
  parsed_response = JSON.parse(response.body)

  parsed_response = {} if parsed_response == ''
  parsed_response
end