how to set http timeout using asp?

后端 未结 2 389
庸人自扰
庸人自扰 2021-01-12 06:30

This is my asp code

<%
http = server.createobject(\"microsoft.xmlhttp\")
http.open \"post\", servleturl, false
http.setrequestheader \"content-type\", \"a         


        
2条回答
  •  鱼传尺愫
    2021-01-12 06:59

    You can also keep using the synchronous request by calling "SetTimeouts" like this:

    <%
    Dim http
    
    Set http = Server.CreateObject("MSXML2.ServerXMLHTTP")
    http.SetTimeouts 600000, 600000, 15000, 15000
    http.Open "post", servleturl, false
    http.SetRequestHeader "content-type", "application/x-www-form-urlencoded"
    http.SetRequestHeader "accept-encoding", "gzip, deflate"
    http.Send  "request=" & sxml
    
    http_response = http.responsetext
    %>
    

    See here for docs.

    The parameters are:

    setTimeouts (long resolveTimeout, long connectTimeout, long sendTimeout, long receiveTimeout)
    

    The setTimeouts method should be called before the open method. None of the parameters is optional.

提交回复
热议问题