Class HttpHandlerUtil


  • public class HttpHandlerUtil
    extends Object
    Provides methods shared by the HTTP handlers.
    Author:
    Stephen Mallette (http://stephen.genoprime.com)
    • Constructor Detail

      • HttpHandlerUtil

        public HttpHandlerUtil()
    • Method Detail

      • getRequestMessageFromHttpRequest

        public static RequestMessage getRequestMessageFromHttpRequest​(io.netty.handler.codec.http.FullHttpRequest request,
                                                                      Map<String,​MessageSerializer<?>> serializers)
                                                               throws SerializationException
        Convert a http request into a RequestMessage. There are 2 payload types options here. 1. existing https://tinkerpop.apache.org/docs/current/reference/#connecting-via-http intended to use with curl, postman, etc. by users both GET and POST Content-Type header can be empty or application/json Accept header can be any, most useful can be application/json, text/plain, application/vnd.gremlin-v3.0+json and application/vnd.gremlin-v3.0+json;types=false Request body example: { "gremlin": "g.V()" } 2. experimental payload with serialized RequestMessage intended for drivers/GLV's. Support both gremlin and bytecode queries. only POST Content-Type is defined by used serializer, expected type GraphSON application/vnd.gremlin-v3.0+json or GraphBinary application/vnd.graphbinary-v1.0. Untyped GraphSON is not supported, it can't deserialize bytecode Accept header can be any. Request body contains serialized RequestMessage
        Throws:
        SerializationException
      • getRequestMessageFromHttpRequest

        public static RequestMessage getRequestMessageFromHttpRequest​(io.netty.handler.codec.http.FullHttpRequest request)
        Convert a http request into a RequestMessage.