简体   繁体   English

将url编码的xml发布到url

[英]Posting an url-encoded xml to the url

Hello I have a xml document in string that I am trying to post to a url. 您好,我有一个要发送到URL的字符串形式的xml文档。

 string xml = File.ReadAllText(Server.MapPath("~/test.txt"));
      myurl=(uri+Server.UrlEncode(xml));
       Response.Write("<a input type="hidden" name="cxml-urlencoded" value="myurl"></a>");

The Response.Write is not working as it is not properly written i get red wiggly underline starting hidden saying expected ")" Any ideas how to go about it? Response.Write不能正常工作,因为它的书写方式不正确,所以我会出现红色的摆动下划线,开始隐藏起来,并说“)”。有什么想法吗? Thanks 谢谢

Try the mini-library I posted here . 试试我在这里发布的小型图书馆。 You'd use it like: 您可以像这样使用它:

HTTP_Post(uri, Server.UrlEncode(xml), DataType.XML)

I don't know if it'd handle the specific field name you need to use, though. 不过,我不知道它是否可以处理您需要使用的特定字段名称。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM