Par*_*Par 4 .net c# request httpwebrequest
我将一个项目的请求发送给另一个项目:
WebRequest request = WebRequest.Create(UrlTemplate);
request.Timeout = 500000;
request.Method = WebRequestMethods.Http.Post;
request.ContentType = ContentType;
byte[] postData = System.Text.Encoding.ASCII.GetBytes(data);
request.ContentLength = postData.Length;
Stream newStream = request.GetRequestStream();
// Send the data.
newStream.Write(postData, 0, postData.Length);
newStream.Flush();
newStream.Close();
Run Code Online (Sandbox Code Playgroud)
好吧,在UrlTemplate我设置的函数中,我得到正确的字符串(我在数据中发送),但是当字符串包含特殊字符时问题就开始了.
如果字符串是: 12&34
我在函数中得到的是:12.
如果字符串是: 12+34
我在函数中得到的是:12 34.
我很高兴知道你们中的一些人是否已经发生过这种情况以及你们是如何解决的.预先感谢.
| 归档时间: |
|
| 查看次数: |
6348 次 |
| 最近记录: |