开发者

Classic ASP, Send POST Request do other domain

I want to be able to send a simple post from 开发者_运维百科an ASP code.

The examples shown in an API tutorial show the use of simple HTML, like that:

<form action="http://api_domain/name_of_function" method="post">
    <input name="field1" type="Text"/>
    <input name="field2" type="Text"/>
</form>

So this HTML sends a post to the API. The POST is sent from the user, from the browser. It may be OK, but the API requires authentication, and placing username and password info inside a form which is sent to the customer is, of course, unacceptable.

Are there any ways to do it from the server, using classic ASP? (I need to send not just textual fields, but also files which I form in the ASP code)


Yes, you should be able to do this using the MSMXL object. var server = Server.CreateObject("MSXML2.ServerXMLHTTP.3.0");

You can see more details and the documentation here: http://msdn.microsoft.com/en-us/library/ms766431%28v=vs.85%29.aspx

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜