/// <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")); }
/// <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)); }
/// <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); }
/// <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)); }