Exemplo n.º 1
0
        /// <summary>
        /// Sends an empty HTTP response appending given headers to the HTTP Response
        /// </summary>
        /// <param name="statusCode">HTTP response status code</param>
        /// <param name="addHeaders">Additional HTTP headers population delegate</param>
        public void Empty(int statusCode, Action <IDictionary <string, string> > addHeaders)
        {
            _controllerBridge.SetResponseCode(statusCode);

            AddResponseHeaders(addHeaders);

            _controllerBridge.SendCancelLayoutAndView();
        }
Exemplo n.º 2
0
        public void Empty(int statusCode, Action <IDictionary <string, string> > addHeaders)
        {
            Dictionary <string, string> headers = new Dictionary <string, string>();

            if (addHeaders != null)
            {
                addHeaders(headers);
            }
            _controllerBridge.SetResponseCode(statusCode);

            foreach (KeyValuePair <string, string> pair in headers)
            {
                _controllerBridge.AppendResponseHeader(pair.Key, pair.Value);
            }
            _controllerBridge.SendCancelLayoutAndView();
        }