Search code examples
flutterinterceptordio

Is it possible to manually set a cookie with Dio in Flutter?


Im using cookieJar interceptor with Dio, but is it also possible to manually add a cookie on top of that?


Solution

  •  final BaseOptions dioBaseOptions = BaseOptions(
    baseUrl: 'http://192.168.1.19',
    headers: {
      'Host': "api.radio.test",
      'Content-Type': 'application/json',
      'Cookie': 'XDEBUG_SESSION=PHPSTORM',
    },
    );