Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error using interceptors #2098

Closed
Supremebosslife opened this issue Jan 17, 2024 · 1 comment
Closed

Error using interceptors #2098

Supremebosslife opened this issue Jan 17, 2024 · 1 comment

Comments

@Supremebosslife
Copy link

lib/api_service.dart(26,41): error G4127D1E8: The getter 'requestInterceptors' isn't defined for the class 'Interceptors'. [C:\Users\LENOVO E490\Apps\voicepally_app\build\windows\x64\flutter\flutter_assemble.vcxproj]

here is the code:
String getCsrfToken() {
var cookieManager = _dio.interceptors.requestInterceptors
.firstWhere((interceptor) => interceptor is CookieManager) as CookieManager;
var cookies = cookieManager.cookieJar.loadForRequest(Uri.parse(baseUrl)) as List;
var csrfCookie = cookies.firstWhere(
(cookie) => cookie.name == 'csrftoken',
orElse: () => Cookie('csrftoken', ''));
return csrfCookie.value;
}

Copy link
Contributor

@Supremebosslife Infra and blank issues are only available for moderators. You're apperantly using the wrong issue template.

Infra 和空白 issue 仅供管理人员使用,请选择其他 issue 模板创建 issue。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant