You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openwhisk.apache.org by cs...@apache.org on 2017/11/16 03:16:28 UTC

[incubator-openwhisk-package-alarms] branch master updated: add parameters as query parameters for get request (#110)

This is an automated email from the ASF dual-hosted git repository.

csantanapr pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-openwhisk-package-alarms.git


The following commit(s) were added to refs/heads/master by this push:
     new 13eb4f8  add parameters as query parameters for get request (#110)
13eb4f8 is described below

commit 13eb4f874fd95ada837474adf16ab4b73e8e4b27
Author: Adnan Baruni <ab...@users.noreply.github.com>
AuthorDate: Wed Nov 15 21:16:27 2017 -0600

    add parameters as query parameters for get request (#110)
---
 action/lib/common.js | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)

diff --git a/action/lib/common.js b/action/lib/common.js
index a6c1477..c62e1f8 100644
--- a/action/lib/common.js
+++ b/action/lib/common.js
@@ -4,12 +4,20 @@ function requestHelper(url, input, method) {
 
     return new Promise(function(resolve, reject) {
 
-        request({
+        var options = {
             method : method,
             url : url,
-            json: input,
+            json: true,
             rejectUnauthorized: false
-        }, function(error, response, body) {
+        };
+
+        if (method === 'get') {
+            options.qs = input;
+        } else {
+            options.body = input;
+        }
+
+        request(options, function(error, response, body) {
 
             if (!error && response.statusCode === 200) {
                 resolve(body);

-- 
To stop receiving notification emails like this one, please contact
['"commits@openwhisk.apache.org" <co...@openwhisk.apache.org>'].