Skip to content

How should i handle shouldInterceptRequest when you have interceptRequest #136

@charlo2433

Description

@charlo2433

Do you have a question regarding how to use the plugin? Please describe.
A clear and concise description of what the question is. Ex. How do I retry a request? [...]

  @override
  Future<BaseRequest> interceptRequest({required BaseRequest request}) async{
     try {
      var token = await GetStorage().read('token');
      request.headers["Content-type"] = "application/json";
      request.headers["Accept"] = "application/json";
      request.headers["Authorization"] = "Bearer " + token;
    } catch (e) {
      print(e);
    }

    return request;
  }

  @override
  Future<bool> shouldInterceptRequest() {
    // TODO: implement shouldInterceptRequest
   
   throw true;
  }

Metadata

Metadata

Assignees

Labels

questionFurther information is requested

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions