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:17:09 UTC

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

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-cloudant.git


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

commit 569862322a16f06ff198f19a7dbc7877ed128b93
Author: Adnan Baruni <ab...@users.noreply.github.com>
AuthorDate: Wed Nov 15 21:17:07 2017 -0600

    add parameters as query parameters for get request (#143)
    
    * add parameters as query parameters for get request
    
    * move json:true to options declaration
    
    * remove trailing whitespace
---
 actions/changes.js | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)

diff --git a/actions/changes.js b/actions/changes.js
index 41c03a2..2bb9ea1 100644
--- a/actions/changes.js
+++ b/actions/changes.js
@@ -30,12 +30,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>'].