public static UrlEncode ( string payload, |
||
payload | string | 인코딩할 문자열 |
enc | 인코딩 방식 | |
return | string |
public void HttpGet() { foreach (string script in ScriptPaths) { var http = new HttpClient(script + "?" + HtmlTool.UrlEncode(PayLoad)); var result = http.Get(); Assert.IsNotEmpty(result, "Result is Empty. script=" + script); if (IsDebugEnabled) { log.Debug(result.EllipsisChar(80)); } } if (IsDebugEnabled) { log.Debug("============================"); } foreach (string script in ScriptPaths) { var httpUtf8 = new HttpClient(script + "?" + HtmlTool.UrlEncode(PayLoad, Encoding.UTF8)); var result = httpUtf8.Get(); Assert.IsNotEmpty(result, "Result is Empty. script=" + script); if (IsDebugEnabled) { log.Debug(result.EllipsisChar(80)); } } }
public void HttpEncoding() { string encoded = HtmlTool.UrlEncode(PayLoad, Encoding.UTF8); Assert.IsNotEmpty(encoded); Assert.AreNotEqual(PayLoad, encoded); if (IsDebugEnabled) { log.Debug("Payload=" + PayLoad); log.Debug("Encoded Payload=" + encoded); } }
public void DownloadData() { var http = new HttpClient(Echo1 + "?" + HtmlTool.UrlEncode(PayLoad, Encoding.UTF8)); var data = http.DownloadData(); Assert.IsNotNull(data); Assert.Greater(data.Length, 0); if (IsDebugEnabled) { log.Debug("Response = " + Encoding.UTF8.GetString(data).EllipsisChar(80)); } }
public void HttpGet2() { var http = new HttpClient(Echo2 + "?" + HtmlTool.UrlEncode(PayLoad)); var result = http.Get(); Assert.IsNotEmpty(result); if (IsDebugEnabled) { log.Debug(result.EllipsisChar(80)); } http = new HttpClient(Echo1 + "?" + HtmlTool.UrlEncode(PayLoad, Encoding.UTF8)); result = http.Get(); Assert.IsNotEmpty(result, "Script=" + http.BaseUriString); if (IsDebugEnabled) { log.Debug(result.EllipsisChar(80)); } }