public JsonRpcProcessor( ICommandLocator commandLocator, IJsonRpcCommandTranslator translator, IJsonRpcHttpConverter converter, IJsonRpcRequestParser requestParser) { this.commandLocator = commandLocator; this.requestParser = requestParser; this.translator = translator; this.converter = converter; }
public JsonRpcModule(IJsonSerializer jsonSerializer, IJsonRpcRequestParser requestParser, IRequestHandler requestHandler) { Post["/jsonrpc"] = _ => { this.RequiresAuthentication(); using (var ms = new MemoryStream()) { Request.Body.CopyTo(ms); var json = Encoding.UTF8.GetString(ms.ToArray()); var request = requestParser.Parse(json); var response = requestHandler.Handle(request); return(Response.AsText(jsonSerializer.SerializeObject(response), "application/json")); } }; }
public JsonRpcModule(IJsonSerializer jsonSerializer, IJsonRpcRequestParser requestParser, IRequestHandler requestHandler) { Post["/jsonrpc"] = _ => { this.RequiresAuthentication(); using (var ms = new MemoryStream()) { Request.Body.CopyTo(ms); var json = Encoding.UTF8.GetString(ms.ToArray()); var request = requestParser.Parse(json); var response = requestHandler.Handle(request); return Response.AsText(jsonSerializer.SerializeObject(response), "application/json"); } }; }
public IntegrationTests() { classUnderTest = new JsonRpcRequestParser(new ApolloJsonSerializer()); }