module App42::Base module HttpHelper # post request to rest client def post_request body, signed, rest_url, params @connection.post(signed, rest_url, params, body) end # put request to rest client def put_request body, signed, rest_url, params @connection.put(signed, rest_url, params, body) end # get request to rest client def get_request signed, rest_url, params @connection.get(signed, rest_url, params) end # delete request to rest client def delete_request signed, rest_url, params @connection.delete(signed, rest_url, params) end # build post request def build_post_request body, query_params, resource, action response = post_request body, signature(query_params), resource_url(resource, action), query_params end # build put request def build_put_request body, query_params, resource, action response = put_request body, signature(query_params), resource_url(resource, action), query_params end # build get request def build_get_request query_params, resource, action response = get_request signature(query_params), resource_url(resource, action), query_params end # build delete request def build_delete_request query_params, resource, action response = delete_request signature(query_params), resource_url(resource, action), query_params end end end