HTTP URL path segment associated with REST method annotated with this tag.
HTTP URL path segment associated with REST method annotated with this tag. This path may be multipart
(i.e. contain slashes). It may also be empty which means that this particular REST method does not contribute
anything to URL path. Any special characters must already be URL-encoded (spaces should be encoded as %20
,
not as +
). If path is not specified explicitly, method name is used (the actual method name, not rpcName
).
trait SomeRestApi { @GET("users/find") def findUser(userId: String): Future[User] } object SomeRestApi extends RestApiCompanion[SomeRestApi]
Base trait for tag annotations that determine how a REST method is translated into actual HTTP request. A REST method may be annotated with one of HTTP method tags (GET, PUT, POST, PATCH, DELETE) which means that this method represents actual HTTP call and is expected to return a
AsyncWrapper[Result]
whereResult
is encodable as RestResponse andAsyncWrapper
represents some abstraction over asynchronous computations (Future
by default - see DefaultRestApiCompanion).If a REST method is not annotated with any of HTTP method tags, then either POST is assumed (if result type is a valid result type for HTTP method) or Prefix is assumed (if result type is another REST trait). Prefix means that this method only contributes to URL path, HTTP headers and query parameters but does not yet represent an actual HTTP request. Instead, it is expected to return instance of some other REST API trait which will ultimately determine the actual HTTP call.