Skip to content

Java template: Make ApiInvoker more pluggable #683

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

Closed
wants to merge 1 commit into from
Closed

Java template: Make ApiInvoker more pluggable #683

wants to merge 1 commit into from

Conversation

karussell
Copy link
Contributor

We needed simple key authentication and with this change you can easily extend the ApiInvoker and e.g. hook into ApiInvoker.invokeAPI to modify the queryParams. And for header based authentication you could change the headers there too.

Example usage:

ApiInvoker myInvoker = new ApiInvoker() {
  public String invokeAPI(String host, String path, String method, Map<String, String> queryParams, ...) {
    queryParams.put("key", someKey);
    super.invokeAPI(host, path, method, queryParams, ...);
  }
}

SomeApi api = new SomeApi(myInvoker);

@karussell karussell changed the title Make ApiInvoker more pluggable Java template: Make ApiInvoker more pluggable Apr 24, 2015
@webron
Copy link
Contributor

webron commented Apr 24, 2015

@karussell - thanks for the PR, but it should be submitted against the develop_2.0 branch.

@karussell
Copy link
Contributor Author

Okay

@karussell karussell closed this Apr 24, 2015
@karussell
Copy link
Contributor Author

I've reposted it as #684 hope it is correct now :)

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

Successfully merging this pull request may close these issues.

2 participants