Example #1
0
        public SillyHttpResponse(SillyHttpStatusCode code, Byte[] payload, string mimeType)
        {
            Version = "HTTP/1.1";
            Payload = payload;

            _proxy = new SillyProxyResponse();
            _proxy.headers.ContentType = mimeType;
        }
 public SillyProxyResponse(SillyHttpStatusCode status = SillyHttpStatusCode.Success)
 {
     headers             = new Headers();
     isBase64Encoded     = false;
     statusCode          = (int)status;
     headers.ContentType = SillyMimeType.TextHtml;
     body = string.Empty;
 }
        private SillyProxyResponse buildErrorResponse(SillyHttpStatusCode statusCode, string details)
        {
            SillyProxyResponse errorResponse = new SillyProxyResponse(statusCode);

            errorResponse.body  = "<h1>Server ERROR</h1><h3>" + errorResponse.StatusCodeToString() + "</h3>";
            errorResponse.body += "<p>" + details + "</p>";

            return(errorResponse);
        }
 public SillyException(SillyHttpStatusCode statusCode, string details)
     : base(details)
 {
     StatusCode = statusCode;
 }