卷起对接子
@bany/curl-to-json (英语) Conver 卷曲为 json 格式 .
安装
npm i @bany/curl-to-json
使用量
const parse = require('@bany/curl-to-json');
var out = parse(`your_curl`);
示例
const parse = require('@bany/curl-to-json');
var out = parse(`curl -X GET 'http://localhost:3001/search?search=react&asdfa=asfdaf' \
--header 'xapi-key: 21432139847290402402190' \
--header 'Content-Type: text/html' \
--data-raw '{
"name": "string",
"name2": "string"
}'`);
console.log(out)
/**
{
method: 'GET',
header: {
'xapi-key': '21432139847290402402190',
'Content-Type': 'text/html'
},
url: 'http://localhost:3001/search',
origin: 'http://localhost:3001',
params: { search: 'react', asdfa: 'asfdaf' },
body: { name: 'string', name2: 'string' }
} */
CURL公约
- 检查此特征
- 接受邮差的卷发.
捐款
欢迎新一期或专题请求.
如果您想协调检查项目的问题 .
- 叉子存储器
- 执行您的解决方案
- 提交
- 打开拉请求
谢谢!