CodingAleCR / http_interceptor

A lightweight, simple plugin that allows you to intercept request and response objects and modify them if desired.
MIT License
134 stars 67 forks source link

[WEB] Unsupported operation: Platform._version #53

Closed BartusZak closed 3 years ago

BartusZak commented 3 years ago
HttpClientWithInterceptor _httpClient;
...
await _httpClient.get();

Result: Unsupported operation: Platform._version

Flutter 1.26.0-17.3.pre • channel beta • https://github.com/flutter/flutter.git
Framework • revision 4b50ca7f7f (8 days ago) • 2021-02-04 19:44:27 -0800       
Engine • revision 2c527d6c7e
Tools • Dart 2.12.0 (build 2.12.0-259.8.beta)

http_interceptor: ^0.3.3

Related to https://github.com/flutter/flutter/issues/39998.

<getObject: NoSuchMethodError: The getter 'uri' was called on null.> http_client_with_interceptor.dart

CodingAleCR commented 3 years ago

Are you by any chance using Flutter for Web?

BartusZak commented 3 years ago

Hey @CodingAleCR,

That's correct.

I was playing around with your library but at the end I had to user Dio.

It has interceptors and supports Web/Android and iOS.

CodingAleCR commented 3 years ago

I'm sorry for the confusion, I have not been able to take the time to add support for Web. I'm glad you found a solution for your problems and happy that you are using Flutter. Cheers from Costa Rica my friend! 🥳🥳

BartusZak commented 3 years ago

Let's leave that issue open then for others.

Pozdrowienia z Polski 👯‍♂️

CodingAleCR commented 3 years ago

This should be fixed as of 0.4.0, it's important that you guys know that the badCertificatesCallback and the findProxy features are not supported on Flutter Web due to browser limitations. Let me know if any other issues persist, also be aware of CORS as while testing I found some issues around it while querying public APIs.