3. Click **GET special character using Chucker Interceptor** button
4. See error
**Expected behavior**
Return HTTP response as original HTTP Client did
**Screenshots**
Using interceptor
![alt text](https://i.ibb.co/wLpsDjt/Simulator-Screenshot-i-Pad-mini-6th-generation-2023-09-15-at-10-39-58.png "Using interceptor")
**Version (please complete the following information):**
- Flutter Version: all
- OS: all
- Chucker Flutter Version : 1.5.2
Describe the bug When using chucker_flutter wrapper as http client, somehow it capture the correct character on chucker log but not as http response.
To Reproduce Steps to reproduce the behavior:
void main() { ChuckerFlutter.showOnRelease = true; runApp(const App()); }
class App extends StatelessWidget { const App({Key? key}) : super(key: key);
@override Widget build(BuildContext context) { return MaterialApp( debugShowCheckedModeBanner: false, navigatorObservers: [ChuckerFlutter.navigatorObserver], theme: ThemeData( appBarTheme: const AppBarTheme(color: Color(0xFF13B9FF)), colorScheme: ColorScheme.fromSwatch( accentColor: const Color(0xFF13B9FF), ), ), home: const TodoPage(), ); } }
class TodoPage extends StatefulWidget { const TodoPage({Key? key}) : super(key: key);
@override State createState() => _TodoPageState();
}
class _TodoPageState extends State {
final _baseUrl = 'https://jsonplaceholder.typicode.com';
final _specialCharacterUrl = "https://gist.githubusercontent.com/fahami/b01f9c23cfa5f1d8f1ac18a1293fa069/raw/alphabet.json";
var _clientType = _Client.http;
String result = "";
late final _dio = Dio( BaseOptions( sendTimeout: 30000, connectTimeout: 30000, receiveTimeout: 30000, ), );
final _originalClient = http.Client();
final _chuckerHttpClient = ChuckerHttpClient(http.Client());
final _chopperApiService = ChopperApiService.create();
Future get({bool error = false, bool specialCharacter = false, bool useOriginalClient = false}) async {
try {
//To produce an error response just adding random string to path
final path = '/post${error ? 'temp' : ''}s/1';
}
@override void initState() { super.initState(); _dio.interceptors.add(ChuckerDioInterceptor()); }
@override Widget build(BuildContext context) { return Scaffold( appBar: AppBar( title: const Text('Chucker Flutter Example'), ), persistentFooterButtons: [ Text('Using ${_clientType.name} library'), const SizedBox(width: 16), ElevatedButton( onPressed: () { setState( () { switch (_clientType) { case _Client.dio: _clientType = _Client.http; break; case _Client.http: _clientType = _Client.chopper; break; case _Client.chopper: _clientType = _Client.dio; break; } }, ); }, child: Text( 'Change to ${_clientType == _Client.dio ? 'Http' : _clientType == _Client.http ? 'Chopper' : 'Dio'}', ), ) ], body: SingleChildScrollView( padding: const EdgeInsets.all(16), child: Column( crossAxisAlignment: CrossAxisAlignment.stretch, children: [ const SizedBox(height: 16), ChuckerFlutter.chuckerButton, const SizedBox(height: 16), ElevatedButton( onPressed: get, child: const Text('GET'), ), ElevatedButton( onPressed: () => get(specialCharacter: true), child: const Text('GET special character using Chucker Interceptor'), ), ElevatedButton( onPressed: () => get(specialCharacter: true, useOriginalClient: true), child: const Text('GET special character using original HTTP Client'), ), Text(result), ], ), ), ); } }
enum _Client { dio, http, chopper, }