title: How to make Dio handle the HTTP 302 code as a regular HTTP code and not an error ? (Http status error [302])
body: <p>Upon sending login data to a remote URL, the website returns a 302 along with the proper login Cookies. When processing it with http or HttpClient, the status code 302 is processed as good, however with Dio it's considered as an error.</p>
  
  <p><strong>How to make Dio handle the HTTP 302 code as a regular HTTP code and not an error ?</strong></p>
  
  <p>Code</p>
  
  <pre><code>Dio dio = new Dio();
  dio.options.contentType = ContentType('application','x-www-form-urlencoded');
  dio.post(urlLogin, data: data).then((Response resp){
    print('-----Login-----');
    List&lt;String&gt; headers = resp.headers['set-cookie'];
    headers.forEach((h) =&gt; print(h));
  });
  </code></pre>
  
  <p>Stack Trace</p>
  
  <pre><code>Unhandled exception:
  DioError [DioErrorType.RESPONSE]: Http status error [302]
  #0      _rootHandleUncaughtError.&lt;anonymous closure&gt; (dart:async/zone.dart:1112:29)
  #1      _microtaskLoop (dart:async/schedule_microtask.dart:41:21)
  #2      _startMicrotaskLoop (dart:async/schedule_microtask.dart:50:5)
  #3      _Timer._runTimers (dart:isolate/runtime/libtimer_impl.dart:391:30)
  #4      _Timer._handleMessage (dart:isolate/runtime/libtimer_impl.dart:416:5)
  #5      _RawReceivePortImpl._handleMessage (dart:isolate/runtime/libisolate_patch.dart:165:12)
  </code></pre>