liyinchigithub / charles2postman Goto Github PK
View Code? Open in Web Editor NEW将Charles抓包文件,转为支持导入postman文件格式
License: Apache License 2.0
将Charles抓包文件,转为支持导入postman文件格式
License: Apache License 2.0
请的参数带有端口例**:3199,导入时请求URL端口没带上
我的时Mac设备(macOS big sur),转换时给出如下错误,请问如何解决
$ sudo sh run.sh
Password:
run.sh: line 1: @echo: command not found
开始转换
node:internal/modules/cjs/loader:936
throw err;
^
Error: Cannot find module 'log4js'
Require stack:
- /Users/xihaozhang/workspace/Git/github/Charles2Postman/index.js
at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15)
at Function.Module._load (node:internal/modules/cjs/loader:778:27)
at Module.require (node:internal/modules/cjs/loader:1005:19)
at require (node:internal/modules/cjs/helpers:102:18)
at Object.<anonymous> (/Users/xihaozhang/workspace/Git/github/Charles2Postman/index.js:1:6785)
at Module._compile (node:internal/modules/cjs/loader:1101:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
at Module.load (node:internal/modules/cjs/loader:981:32)
at Function.Module._load (node:internal/modules/cjs/loader:822:12)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12) {
code: 'MODULE_NOT_FOUND',
requireStack: [ '/Users/xihaozhang/workspace/Git/github/Charles2Postman/index.js' ]
}
输出文件outputFile
感谢作者提供的好工具,请问这个工具是否支持批量转换?
就是例如我的接口再charles展示结构如下:
-user
--fetchUser
--deleteUser
--updateUser
--addUser
1.此时我从user右键Export Session然后导出一个 xxx.chlsj
2.放入Charles2Postman的File文件夹下 执行run.bat
3.但是得到报错如下:
SyntaxError: Unexpected token � in JSON at position 0
at JSON.parse ()
at D:\mjq\test_code\Charles2Postman\index.js:1:10529
at Array.forEach ()
at Object.getFilesName (D:\xxx\test_code\Charles2Postman\index.js:1:10160)
at Object. (D:\xxx\test_code\Charles2Postman\index.js:1:20075)
at Module._compile (internal/modules/cjs/loader.js:1133:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1153:10)
at Module.load (internal/modules/cjs/loader.js:977:32)
at Function.Module._load (internal/modules/cjs/loader.js:877:14)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:74:12)
开始转换
internal/modules/cjs/loader.js:968
throw err;
^
Error: Cannot find module 'log4js'
Require stack:
charles设置了仅抓取 host为xxxx的 请求,启动app抓取到大概20个请求后,导出并转换,再导入postman,仅有第一个请求。从charlea导出的文件有157KB,转换完成后的文件仅2KB。
不管是用这个工具转还是用cURL的方式,表单参数都导入不到postman里面,不知道您是否有其他好的方法
.DS_Store undefined:1 SyntaxError: Unexpected token
[2020-07-09T12:02:53.960] [INFO] default - 返回文件数组列表:.DS_Store,Untitled.chlsj
[2020-07-09T12:02:53.967] [INFO] default - [ 'File/.DS_Store', 'File/Untitled.chlsj' ]
undefined:1
SyntaxError: Unexpected token in JSON at position 0
at JSON.parse ()
at /Users/bai/Desktop/Charles2Postman/index.js:2:10903
at Array.forEach ()
at Object.getFilesName (/Users/bai/Desktop/Charles2Postman/index.js:2:10422)
at Object. (/Users/bai/Desktop/Charles2Postman/index.js:2:18214)
at Module._compile (internal/modules/cjs/loader.js:1200:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1220:10)
at Module.load (internal/modules/cjs/loader.js:1049:32)
at Function.Module._load (internal/modules/cjs/loader.js:937:14)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:71:12)
作者您好,非常感谢您的开源,我有下面这个问题,您可以抽空看下吗?
从charles中选择多个接口导出chlsj后,再运行run start命令,只会保留一个接口吗?
还是说必须每个接口都选择导出chlsj文件?
不管是用这个工具转还是用cURL的方式,表单参数都导入不到postman里面,不知道您是否有其他好的方法
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.