将标题添加到POST

时间:2014-09-08 12:30:14

标签: vb.net post soap

我想在VB.Net中发布XML数据时传递标题。

它需要看起来像这样:

POST /test1.asmx HTTP/1.1
Host: www.test1.com
Content-Type: text/xml; charset=utf-8
Content-Length: length
SOAPAction: "http://test1.org/PostApplication_V5"

我使用以下内容:

Req.Headers.Add("POST /", "test1.asmx HTTP/1.1")
            Req.Headers.Add("HOST", "www.test1.com")
            Req.Headers.Add("Content-Type", "text/xml; charset=utf-8")
            Req.Headers.Add("Content-Length", "length")
            Req.Headers.Add("SOAPAction", """http://test1.org/PostApplication_V5""")

它不起作用

1 个答案:

答案 0 :(得分:0)

<POST /test1.asmx HTTP/1.1>
<Host: www.test1.com>
<Content-Type: text/xml; charset=utf-8>
<Content-Length: length>
<SOAPAction: "http://test1.org/PostApplication_V5">

</POST /test1.asmx HTTP/1.1>
</Host: www.test1.com>
</Content-Type: text/xml; charset=utf-8>
</Content-Length: length>
</SOAPAction: "http://test1.org/PostApplication_V5">