Class ServiceResponse
java.lang.Object
io.vertx.ext.web.api.service.ServiceResponse
Data object that encapsulates all informations about an HTTP Response
-
Constructor Summary
ConstructorsConstructorDescriptionServiceResponse(JsonObject json) ServiceResponse(ServiceResponse other) ServiceResponse(Integer statusCode, String statusMessage, Buffer payload, MultiMap headers) -
Method Summary
Modifier and TypeMethodDescriptionstatic ServiceResponsecompletedWithJson(Buffer json) Creates aServiceResponsewith status code 200, status message OK, content typeapplication/jsonandjsonas bodystatic ServiceResponsecompletedWithJson(JsonArray jsonArray) Creates aServiceResponsewith status code 200, status message OK, content typeapplication/jsonandjsonArrayas bodystatic ServiceResponsecompletedWithJson(JsonObject jsonObject) Creates aServiceResponsewith status code 200, status message OK, content typeapplication/jsonandjsonObjectas bodystatic ServiceResponsecompletedWithPlainText(Buffer text) Creates aServiceResponsewith status code 200, status message OK, content typetext/plainandtextas bodysetHeaders(MultiMap headers) setPayload(Buffer payload) setStatusCode(Integer statusCode) setStatusMessage(String statusMessage) toJson()
-
Constructor Details
-
ServiceResponse
public ServiceResponse() -
ServiceResponse
-
ServiceResponse
-
ServiceResponse
-
-
Method Details
-
toJson
-
getStatusCode
-
getStatusMessage
-
getPayload
-
getHeaders
-
setHeaders
-
setStatusCode
-
setStatusMessage
-
setPayload
-
putHeader
-
completedWithJson
Creates aServiceResponsewith status code 200, status message OK, content typeapplication/jsonandjsonObjectas body- Parameters:
jsonObject-- Returns:
-
completedWithJson
Creates aServiceResponsewith status code 200, status message OK, content typeapplication/jsonandjsonArrayas body- Parameters:
jsonArray-- Returns:
-
completedWithJson
Creates aServiceResponsewith status code 200, status message OK, content typeapplication/jsonandjsonas body- Parameters:
json-- Returns:
-
completedWithPlainText
Creates aServiceResponsewith status code 200, status message OK, content typetext/plainandtextas body- Parameters:
text-- Returns:
-