curl-to-json-convert
v1.0.9
Published
Convert Curl to Json Format Easy and Simple, Additional Feature compare to other converter.
Downloads
175
Maintainers
Readme
Curl to Json
NEW UPDATE Added Multiple support to PARAMETERS
curl-to-json converts curl requests to JSON requests
Easy to use inside Frontend, no Backend support needed (Nodejs NPM packages)
Also Support For NPM (easy include using require("curl-to-json-convert"))
No Dependencies if Used Directly from Frontend(download from github)
Example
Curl
curl -X POST -H "Content-Type: application/json" \
-H 'Accept-Encoding: gzip, deflate' \
-H 'Accept-Language: en-US,en;q=0.8,da;q=0.6' \
-d '{"name": "Harsh", "email": "[email protected]", "message": "Hello I am Harsh"}' \
https://github.com/HARSHSINGH0
Json
{
"header": {
"Content-Type": "application/json",
"Accept-Encoding": "gzip, deflate",
"Accept-Language": "en-US,en;q=0.8,da;q=0.6"
},
"method": "POST",
"url": "https://github.com/HARSHSINGH0",
"data": {
"name": "Harsh",
"email": "[email protected]",
"message": "Hello I am Harsh"
}
}
Usage If using NPM Package
var curlToJsonConvert = require("curl-to-json-convert")
console.log(curlToJsonConvert("curl www.example.com"))
Usage If using Direct Download for Frontend (No dependencies)
<script src="curl-to-json-object1.js"></script>
<script>
const curlCommand = "curl -X POST -H "Content-Type: application/json" \
-H 'Accept-Encoding: gzip, deflate' \
-H 'Accept-Language: en-US,en;q=0.8,da;q=0.6' \
-d '{"name": "Harsh", "email": "[email protected]", "message": "Hello I am Harsh"}' \
https://github.com/HARSHSINGH0";
console.log(curltojsonobject(curlCommand));
</script>
Author https://github.com/HARSHSINGH0