Module: Laraib::ClientOps
- Included in:
- Client
- Defined in:
- lib/laraib/client_ops.rb
Instance Method Summary collapse
-
#get(uri) ⇒ Object
NOTE this may be better off as a raw response.
-
#post(uri, body, content_type = 'application/json') ⇒ Object
Typical JSON payload for posting a note looks something like this: “post”, “object”: {“objectType”: “note”, “content”: “your message here”}.
Instance Method Details
#get(uri) ⇒ Object
NOTE this may be better off as a raw response
21 22 23 24 |
# File 'lib/laraib/client_ops.rb', line 21 def get(uri) response = @access_token.get(uri) JSON.parse(response.body) end |
#post(uri, body, content_type = 'application/json') ⇒ Object
Typical JSON payload for posting a note looks something like this:
{"verb": "post", "object": {"objectType": "note", "content": "your message here"}}
28 29 30 31 |
# File 'lib/laraib/client_ops.rb', line 28 def post(uri, body, content_type = 'application/json') response = @access_token.post(uri, body, {'Content-Type' => content_type}) JSON.parse(response.body) end |