Skip to content

Repository files navigation

Restler

Overview

Restler is a library that generates a client of a web service by its annotated Spring controller interface at runtime.

Simple usage example

/** * An annotated Spring controller interface*/@Controller@RequestMapping("greeter")
publicinterfaceGreeter {
@RequestMapping("greetings/{language}") StringgetGreeting(@PathVariableStringlanguage, @RequestParam(defaultValue = "Anonimous") Stringname); }
// Consuming code Serviceservice = newService("https://www.excelsior-usa.com/api");
Greetergreeter = service.getController(Greeter.class);
Stringgreeting = greeter.getGreeting("en","Boddy"); // the result of https://www.excelsior-usa.com/api/greeter/greetings/en?name=Boddy call// Session support in consuming codeServiceservice = newService("https://www.excelsior-usa.com/api");
AuthorizationStrategyauthorizationStrategy = newLoginAuthorizationStrategy(...);
Sessionsession = service.startSession(authorizationStrategy);
Greetergreeter = service.getController(Greeter.class);
Stringgreeting = greeter.getGreeting("en","Boddy");

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages