Created
September 3, 2014 15:01
-
-
Save antongudkov/edd9af030571ddfecfa7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def api_request(action, ndpoint, params) | |
url = "/api/v#{API_VERSION}/#{endpoint}" | |
params = fulltext_params_merge(params) | |
response = http_client.send(:action) do |request| | |
request.url url, params | |
set_request_headers(request) | |
end | |
response.body | |
end | |
def api_request_post(endpoint, params = {}) | |
api_request(:post, endpoint, params) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment