Charles实现本地数据mock,接口报404

1.设置Charles菜单栏tools中的Map Local

Charles实现本地数据mock,接口报404

2.add一条Mapping

切记:不要用localhost,用localhost.charlesproxy.com

并且Path一定要加后缀,如下所示:/list.json,一定要加.json,不然也会报404

Charles实现本地数据mock,接口报404

3.浏览器中访问时也不能直接使用localhost加端口号,要用localhost.charlesproxy.com加端口号,如:

localhost.charlesproxy.com:3000

Charles实现本地数据mock,接口报404