【问题标题】:Access the Body of Request (text/xml)访问请求正文 (text/xml)
【发布时间】:2011-10-11 15:07:27
【问题描述】:

如何在 ASP .NET (C#) 的服务器端访问 Request 的主体 (content),其 content-typetext/xml。 (不是响应内容)

【问题讨论】:

    标签: c# httpwebrequest xmlhttprequest content-type


    【解决方案1】:
    byte[] bytes = Request.BinaryRead(Request.ContentLength);
    System.Text.Encoding enc = System.Text.Encoding.UTF8;
    _XmlData = enc.GetString(bytes);
    

    【讨论】:

      【解决方案2】:

      查看HttpRequest 类,特别是HttpRequst.InputStream 属性。

      【讨论】:

        猜你喜欢
        • 2015-10-19
        • 1970-01-01
        • 1970-01-01
        • 2019-11-14
        • 1970-01-01
        • 2011-09-02
        • 1970-01-01
        • 2015-03-20
        • 1970-01-01
        相关资源
        最近更新 更多