Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'qa/qa/support/api.rb')
-rw-r--r--qa/qa/support/api.rb23
1 files changed, 16 insertions, 7 deletions
diff --git a/qa/qa/support/api.rb b/qa/qa/support/api.rb
index f5e4d4e294b..3c46c039eae 100644
--- a/qa/qa/support/api.rb
+++ b/qa/qa/support/api.rb
@@ -11,22 +11,31 @@ module QA
HTTP_STATUS_ACCEPTED = 202
HTTP_STATUS_SERVER_ERROR = 500
- def post(url, payload)
- RestClient::Request.execute(
+ def post(url, payload, args = {})
+ default_args = {
method: :post,
url: url,
payload: payload,
- verify_ssl: false)
+ verify_ssl: false
+ }
+
+ RestClient::Request.execute(
+ default_args.merge(args)
+ )
rescue RestClient::ExceptionWithResponse => e
return_response_or_raise(e)
end
- def get(url, raw_response: false)
- RestClient::Request.execute(
+ def get(url, args = {})
+ default_args = {
method: :get,
url: url,
- verify_ssl: false,
- raw_response: raw_response)
+ verify_ssl: false
+ }
+
+ RestClient::Request.execute(
+ default_args.merge(args)
+ )
rescue RestClient::ExceptionWithResponse => e
return_response_or_raise(e)
end