예제 #1
0
        public CommandReply(string command,
                            EslMessage response)
        {
            Command   = command;
            Response  = response;
            ReplyText = Response != null?Response.HeaderValue(EslHeaders.ReplyText) : string.Empty;

            IsOk = !string.IsNullOrEmpty(ReplyText) && ReplyText.StartsWith(EslHeadersValues.Ok);
        }
예제 #2
0
        public string this[string headerName]
        {
            get
            {
                if (_ignoreBody)
                {
                    if (_response.HasHeader(headerName))
                    {
                        return(_response.HeaderValue(headerName));
                    }
                    if (_response.HasHeader("variable_" + headerName))
                    {
                        return(_response.HeaderValue("variable_" + headerName));
                    }
                }

                var map = _response.ParseBodyLines();
                if (map.ContainsKey(headerName))
                {
                    return(map[headerName]);
                }
                return(map.ContainsKey("variable_" + headerName) ? map["variable_" + headerName] : null);
            }
        }