Skip to content

Latest commit

 

History

History
61 lines (47 loc) · 1.43 KB

zero-typed.md

File metadata and controls

61 lines (47 loc) · 1.43 KB

Parameter type supported.

The parameters ( Not belong to specific ), must be annotated with following

  • javax.ws.rs.QueryParam
  • javax.ws.rs.FormParam
  • javax.ws.rs.MatrixParam
  • javax.ws.rs.PathParam
  • javax.ws.rs.HeaderParam
  • javax.ws.rs.CookieParam
  • io.zerows.core.web.io.annotations.BodyParam
  • io.zerows.core.web.io.annotations.StreamParam
  • io.zerows.core.web.io.annotations.SessionParam

The following parameter could be used by type without annotation ( Mustn't include )

  • io.vertx.ext.web.Session
  • io.vertx.core.http.HttpServerRequest
  • io.vertx.core.http.HttpServerResponse
  • io.vertx.core.eventbus.EventBus
  • io.vertx.core.Vertx
  • io.vertx.ext.auth.User
  • io.vertx.ext.web.RoutingContext

1. Source Code

package org.exmaple;

import io.vertx.core.http.HttpServerRequest;
import io.vertx.up.annotations.EndPoint;

import javax.ws.rs.*;

@Path("/up/example")
@EndPoint
public class ZeroExpApi {
    // ... Other
    @GET
    @Path("/typed/request")
    public String sayBody(
            final HttpServerRequest request
    ) {
        return request.absoluteURI();
    }
}

2. Console

[ ZERO ] ( Uri Register ) "/up/example/typed/request" has been deployed by ZeroHttpAgent

3. Curl Testing

curl http://localhost:6083/up/example/typed/request
{"brief":"OK","status":200,"data":"http://localhost:8083/up/example/typed/request"}