/// <summary> /// Supply a request call to the hosted site, and get back a response. /// This is done synchronously. /// </summary> /// <param name="request">Request from client</param> /// <returns>Response from server</returns> public SerialisableResponse DirectCall(SerialisableRequest request) { var conn = new MemoryConnection(request); GetHost()?.ProcessRequest(conn); return(conn.GenerateResponse()); }
/// <summary> /// Make a deep copy of this request /// </summary> public SerialisableRequest Clone() { var result = new SerialisableRequest { IsSecureConnection = IsSecureConnection, CommandControl = CommandControl, Method = Method, RequestUri = RequestUri, Headers = CopyOf(Headers) }; if (Content != null) { result.Content = (byte[])Content.Clone(); } return(result); }