lixqajsapi v1.0.49
��# JavaScriptAPI
Simple API sender for NodeJS, which was created for the Lixqa API but also works with other endpoints.
Using chalk & axios
> npm i lixqajsapi
Example
const { sendApi, ApiRequestMethod } = require("lixqajsapi");
let apiData = await sendApi(
{
url: "https://google.com/", /*## 1 ##*/
method: ApiRequestMethod.POST, /*## 2 ##*/
headers: { /*## 3 ##*/
"Authorization": "value",
"key2": "value2"
},
body: { /*## 4 ##*/
"user": "admin",
"password": "passwd"
}
},
{ /*## 5 ##*/
showOutput: true,
showError: true,
showDetailedError: true
}
);
console.log(apiData) /*## 6 ##*/
- 1 URL: Set the target URL
- Required: '�
- 2 Method: Use the ApiRequestMehod Object to select a Request Method
- Required: L'
- Default: GET
- Options: GET, POST, PUT, DELETE
- 3 Headers: Send headers to target (key-value)
- Required: L'
- Default: null
- 4 Body: Send body to target (object)
- Required: L'
- Default: null
5 Options: Set options (object)
Required: L'
showLog: Send log if request was successful (Default: true)
- showError: Send error log if request failed (Default: true)
showDetailedError: Send Axios error object if request failed (Default: false)
(Script options -> Script don't track if the API returned a internal error or something)
- 6 Output: Object with response data
6 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
11 months ago
11 months ago
11 months ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago