public static string GetRequestJson(this IRESTfulApi rest) { var input = HttpContext.Current.Request.InputStream; using (MemoryStream m = new MemoryStream()) { input.CopyTo(m); m.Position = 0; input.Position = 0; using (var reader = new StreamReader(m)) { return(reader.ReadToEnd()); } } }
public static void SetResponseCode(this IRESTfulApi rest, int code) { HttpContext.Current.Response.StatusCode = code; }
public static NameValueCollection GetQueryParam(this IRESTfulApi rest) { return(HttpContext.Current.Request.QueryString); }
public static HttpContext GetHttpContext(this IRESTfulApi rest) { return(HttpContext.Current); }