Class HttpHandlerUtil
java.lang.Object
org.apache.tinkerpop.gremlin.server.handler.HttpHandlerUtil
Provides methods shared by the HTTP handlers.
- Author:
- Stephen Mallette (http://stephen.genoprime.com)
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidsendError(io.netty.channel.ChannelHandlerContext ctx, io.netty.handler.codec.http.HttpResponseStatus status, String message, CharSequence... headers) Helper method to send errors back as JSON.
-
Constructor Details
-
HttpHandlerUtil
public HttpHandlerUtil()
-
-
Method Details
-
sendError
public static void sendError(io.netty.channel.ChannelHandlerContext ctx, io.netty.handler.codec.http.HttpResponseStatus status, String message, CharSequence... headers) Helper method to send errors back as JSON. Only to be used when the RequestMessage couldn't be parsed, because a proper serialized ResponseMessage should be sent in that case.- Parameters:
ctx- The netty channel context.status- The HTTP error status code.message- The error message to contain the body.headers- Optional alternating header name/value pairs to set on the response.
-