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

Basic auth #51

Open
salhugues opened this issue Apr 9, 2019 · 0 comments
Open

Basic auth #51

salhugues opened this issue Apr 9, 2019 · 0 comments

Comments

@salhugues
Copy link

salhugues commented Apr 9, 2019

Hello, I'm looking for an example to add basicauth for my request I haven't found an example on the net for jaguar_ retrofit if somebody can help me.

Here's is my request for my api but I don't know how can I add header and pass basic auth.

class MyApi  extends ApiClient with _$MyApiClient {

  final resty.Route base;
  MyApi(this.base);

  @GetReq(path: "json/works")
  Future<List<MyApiObject>> fetchWorks();

  @GetReq(path: "json/editos")
  Future<List<MyApiObject>> fetchEditos();
}

// My Api Factory
MyApi getMyApi() {

    globalClient = IOClient();
    final repo =
    JsonRepo()
      ..add(MyApiObjectSerializer())
      ..add(UndListSerializer())
      ..add(UndSerializer()); // Don't forget to add all Serializer

    return MyApi(route(StringResources.MY_API_BASE_URL))..jsonConverter = repo;
  }

Thanks for your help.

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