1.1.1 • Published 7 years ago

httpaction v1.1.1

Weekly downloads
9
License
MIT
Repository
bitbucket
Last release
7 years ago

npm install httpaction

required

Should have a config name folder at /

configuration should be JSON format only.

send request

const {httpRequest} = ("httpaction");

params

method :- should be (get post) or you can add in your config or default get

headers :-send headers whatever you want

defaultHeaders = {
    "Content-Type": "application/json; charset=utf-8",
    "mode"        : 'no-cors'

};

payload :- send data as payload

example ("CLEVERTAP") :- means should pass config key which you want to use in this call

Url:- url should be in your config key.

params.auth == true :- we can set unique as uuid in cookies

#version 1.0.10

httpRequest("CLEVERTAP",params = {},function(err,res,body){
 
    if(err) console.log(err)
 
    console.log(JSON.stringify(body))
 
});

#version 1.1.0

  1. Promise based response
  2. params will be converted as querystring in get request
httpRequest("CLEVERTAP",params = {}).then((res)=>{
    console.log(">>>>>>> ",res);
},(error)=>{
    console.log(">>>>>>> err ",error);
}).catch((error)=>{
    console.log(">>>>>>> err ",error);
});

#version 1.1.1

  1. configuration name validation

config folder

Please check config folder for same

config file name in config folder should follow as config.{env}.json

author

Nitin tyagi

Please contact @ nitin.1992tyagi@gmail.com

1.1.1

7 years ago

1.1.0

7 years ago

1.0.10

7 years ago

1.0.9

7 years ago

1.0.8

7 years ago

1.0.7

7 years ago

1.0.6

7 years ago

1.0.5

7 years ago

1.0.4

7 years ago

1.0.3

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago