Пример #1
0
 public static void EnsureResponseInfo(this WebCallContext context)
 {
     if (context.Response == null)
     {
         context.Response = new ResponseInfo();
     }
 }
Пример #2
0
 public static void SetResponse(this WebCallContext context, object body = null, string contentType = "text/plain",
                                HttpStatusCode?status = null)
 {
     context.EnsureResponseInfo();
     if (body != null)
     {
         context.Response.Body            = body;
         context.Response.BodyContentType = contentType;
     }
     if (status != null)
     {
         context.Response.HttpStatus = status.Value;
     }
 }
Пример #3
0
 public static void MarkConfidential(this WebCallContext context)
 {
     context.Flags |= WebCallFlags.Confidential;
 }
Пример #4
0
 public static void SetResponseHeader(this WebCallContext context, string name, string value)
 {
     context.EnsureResponseInfo();
     context.Response.Headers[name] = value;
 }