GithubHelp home page GithubHelp logo

Comments (5)

lijy91 avatar lijy91 commented on July 19, 2024

这是 Dio 2.0 的示例,请将示例中的 flipper_dio_interceptor.dart 文件添加到你的项目
https://github.com/blankapp/flutter_flipperkit/blob/master/example/lib/networking/api_client/api_client.dart

BaseOptions options = new BaseOptions(
      baseUrl: 'https://www.v2ex.com/api',
      connectTimeout: 5000,
      receiveTimeout: 3000,
      headers: {
        "Accept": "application/json",
        "Content-Type": "application/json"
      },
      responseType: ResponseType.json,
    );
    this._http = new Dio(options);
    // 添加 FlipperDioInterceptor 拦截器
    this._http.interceptors.add(FlipperDioInterceptor());

from flutter_flipperkit.

zakiso avatar zakiso commented on July 19, 2024

只有使用dio做为网络请求客户端的时候 才能用吗?

from flutter_flipperkit.

lijy91 avatar lijy91 commented on July 19, 2024

@zakiso flutter_flipperkit (将在 0.0.7 中发布该功能,请留意版本更新) 已支持全局拦截网络请求(所有基于 HttpClient API 的请求均可被拦截),如果你未设置网络插件 useHttpOverrides 参数为 false,则无需使用该拦截器。

如果其他网络请求库无法被自动拦截,则可能参考 Dio 的实现。
https://github.com/blankapp/flutter_flipperkit_plugins/tree/master/packages/flipperkit_dio_interceptor

如有疑问可加入电报群 https://t.me/flutterdebugger 提问。

from flutter_flipperkit.

zakiso avatar zakiso commented on July 19, 2024

👍 期待新版本

from flutter_flipperkit.

lijy91 avatar lijy91 commented on July 19, 2024

@zakiso Flutter Debugger 已经发布,
下载:https://github.com/blankapp/flutter-debugger/releases/
文档:https://flutter-debugger.blankapp.org/

from flutter_flipperkit.

Related Issues (20)

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.