/// <summary> /// Performs a Post operation on /// </summary> /// <param name="path">The resource being request, for example <c>home/index.rails</c></param> /// <param name="postStringParams">A list of key/value pair, for example <c>name=johndoe</c></param> public void DoPost(String path, params String[] postStringParams) { if (postStringParams.Length != 0) { Request.PostParams = postStringParams; } outputBuffer.Length = 0; int pos = path.IndexOf('?'); if (pos > -1) { string qs = path.Substring(pos + 1); path = path.Substring(0, pos); Request.QueryStringParams = qs.Split('&'); } Request.Url = path; Request.Verb = "POST"; StringWriter writer = new StringWriter(outputBuffer); response = host.Process(Request, writer); }
/// <summary> /// Performs a GET operation on /// </summary> /// <param name="path">The resource being request, for example <c>home/index.rails</c></param> /// <param name="queryStringParams">A list of key/value pair, for example <c>name=johndoe</c></param> public void DoGet(String path, params String[] queryStringParams) { AssertPathIsValid(path); if (queryStringParams.Length != 0) { Request.QueryStringParams = queryStringParams; } outputBuffer.Length = 0; Request.Url = path; StringWriter writer = new StringWriter(outputBuffer); response = host.Process(Request, writer); }
private void SendRequest() { outputBuffer = new StringBuilder(); StringWriter writer = new StringWriter(outputBuffer); if (Request.Headers["IsTestWorkerRequest"] == null) { Request.Headers.Add("IsTestWorkerRequest", "true"); } response = host.Process(Request, writer); writer.Close(); }