Beispiel #1
0
 public static void EnsureResponseInfo(this WebCallContext context)
 {
     if (context.Response == null)
     {
         context.Response = new ResponseInfo();
     }
 }
Beispiel #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;
     }
 }
Beispiel #3
0
 public static void MarkConfidential(this WebCallContext context)
 {
     context.Flags |= WebCallFlags.Confidential;
 }
Beispiel #4
0
 public static void SetResponseHeader(this WebCallContext context, string name, string value)
 {
     context.EnsureResponseInfo();
     context.Response.Headers[name] = value;
 }