コード例 #1
0
        /// <summary>
        /// Handle the incoming request.
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        public HttpResult Handle(HttpListenerRequest request)
        {
            if (request == null)
            {
                throw new ArgumentNullException(nameof(request));
            }

            string file = request.Url.ToString().Replace(request.UrlReferrer.ToString(), "./");

            if (File.Exists(file) == false)
            {
                return(HttpResult.Empty(HttpStatusCode.NotFound));
            }

            return(HttpResult.FromBytes(HttpStatusCode.OK, File.ReadAllBytes(file), "image/jpeg"));
        }
コード例 #2
0
 /// <summary>
 /// Handles the resulted context.
 /// </summary>
 /// <param name="context"></param>
 /// <returns></returns>
 public HttpResult Handle(MessagingContext context)
 {
     Logger.Debug("Respond with 202 Accepted: message will be forwarded");
     return(HttpResult.Empty(HttpStatusCode.Accepted));
 }
コード例 #3
0
 /// <summary>
 /// Handles the resulted context.
 /// </summary>
 /// <param name="context"></param>
 /// <returns></returns>
 public HttpResult Handle(MessagingContext context)
 {
     Logger.Debug("Respond with 202 Accepted: Receipt/Errors are responded async");
     return HttpResult.Empty(HttpStatusCode.Accepted);
 }
コード例 #4
0
 /// <summary>
 /// Handles the resulted context.
 /// </summary>
 /// <param name="context"></param>
 /// <returns></returns>
 public HttpResult Handle(MessagingContext context)
 {
     Logger.Debug("Respond with 202 Accepted: unknown reason");
     return(HttpResult.Empty(HttpStatusCode.Accepted));
 }