lib/ketra/client.rb
def post(endpoint, params = {})
      internal_params = params.dup
      resp = access_token.post url(endpoint),
                               :params => internal_params.delete(:query_params),
                               :body => JSON.generate(internal_params),
                               :headers => { 'Content-Type' => 'application/json' }
      JSON.parse resp.body
    end
# performs a POST request using the OAuth2 Access Token and parses the result as JSON
#
# @param [String] endpoint to be appended to the base url
# @param [Hash] params except :query_params will be serialized into JSON and supplied as the body of the request
# @option params [Hash] :query_params to be used as the query params for the request
# @return [Hash] deserialized response hash
performs a POST request using the OAuth2 Access Token and parses the result as JSON
performs a POST request using the OAuth2 Access Token and parses the result as JSON
def post(endpoint, params = {})
      internal_params = params.dup
      resp = access_token.post url(endpoint),
                               :params => internal_params.delete(:query_params),
                               :body => JSON.generate(internal_params),
                               :headers => { 'Content-Type' => 'application/json' }
      JSON.parse resp.body
    end
def post ( endpoint , params = { } ) internal_params = params . dup resp = access_token . post url ( endpoint ) , :params => internal_params . delete ( :query_params ) , :body => JSON . generate ( internal_params ) , :headers => { 'Content-Type' => 'application/json' } JSON . parse resp . body end
performs a POST request using the OAuth2 Access Token and parses the result as JSON
performs a POST request using the OAuth2 Access Token and parses the result as JSON
deserialized response hash
deserialized response hash
Hash
endpoint
params
:query_params to be used as the query params for the request
: query_params to be used as the query params for the request
params except :query_params will be serialized into JSON and supplied as the body of the request
params except : query_params will be serialized into JSON and supplied as the body of the request