Skip to content

Add Axios Target - #176

Merged
reynolek merged 4 commits into
Kong:masterfrom
rohit-gohri:axios
Aug 16, 2020
Merged

Add Axios Target#176
reynolek merged 4 commits into
Kong:masterfrom
rohit-gohri:axios

Conversation

@rohit-gohri

@rohit-gohrirohit-gohri commented Aug 11, 2020

Copy link
Copy Markdown
Contributor

Closes#155

Added for both node (require/commonjs syntax) and javascript (import/esm syntax)
I haven't tested the multipart form-data part so if anyone could confirm that is working that'd be great.

Axios Docs: https://github.com/axios/axios

Example Output:
node_axios target

varaxios=require("axios").default;varoptions={method: 'POST',url: 'https://example.com/api/item/1000',headers: {'content-type': 'application/json','api-key': 'REPLACE_KEY_VALUE'},data: {status: 'INACTIVE'}};axios.request(options).then(function(response){console.log(response.data);}).catch(function(error){console.error(error);});

javascript_axios target

importaxiosfrom"axios";constoptions={method: 'POST',url: 'https://example.com/api/item/1000',headers: {'content-type': 'application/json','api-key': 'REPLACE_KEY_VALUE'},data: {status: 'INACTIVE'}};axios.request(options).then(function(response){console.log(response.data);}).catch(function(error){console.error(error);});

@rohit-gohri
rohit-gohri marked this pull request as draft August 11, 2020 14:08
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Axios conversion

2 participants

@rohit-gohri@reynolek