Code Monkey home page Code Monkey logo

charles2postman's Issues

转换时报错,错误信息见详情

我的时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:

  • /Users/mazhigang3/Downloads/Charles2Postman-master/index.js
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:965:15)
    at Function.Module._load (internal/modules/cjs/loader.js:841:27)
    at Module.require (internal/modules/cjs/loader.js:1025:19)
    at require (internal/modules/cjs/helpers.js:72:18)
    at Object. (/Users/mazhigang3/Downloads/Charles2Postman-master/index.js:1:6785)
    at Module._compile (internal/modules/cjs/loader.js:1137:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1157:10)
    at Module.load (internal/modules/cjs/loader.js:985:32)
    at Function.Module._load (internal/modules/cjs/loader.js:878:14)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:71:12) {
    code: 'MODULE_NOT_FOUND',
    requireStack: [ '/Users/mazhigang3/Downloads/Charles2Postman-master/index.js' ]
    }

转换后的文件仅有charles抓取的第一个请求

charles设置了仅抓取 host为xxxx的 请求,启动app抓取到大概20个请求后,导出并转换,再导入postman,仅有第一个请求。从charlea导出的文件有157KB,转换完成后的文件仅2KB。

发现表单数据导不进来

不管是用这个工具转还是用cURL的方式,表单参数都导入不到postman里面,不知道您是否有其他好的方法

执行过程中遇到的问题

  1. 请求的本地url中包含端口号时,导出的文件中url缺少端口号;
  2. 导出的文件中,存在丢失Body的情况
    请问,这两个问题如何解决

解析发生错误

[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中选择多个接口进行导出吗?

作者您好,非常感谢您的开源,我有下面这个问题,您可以抽空看下吗?
从charles中选择多个接口导出chlsj后,再运行run start命令,只会保留一个接口吗?
还是说必须每个接口都选择导出chlsj文件?

发现表单数据导不进来

不管是用这个工具转还是用cURL的方式,表单参数都导入不到postman里面,不知道您是否有其他好的方法

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.