home *** CD-ROM | disk | FTP | other *** search
/ Internet Pratica / IPRAT_01.iso / ASP / ASPFusion_Basic_Suite / examples / asp / advhttp / act_post.asp < prev    next >
Encoding:
Text File  |  2001-04-17  |  1.3 KB  |  40 lines

  1. <html>
  2. <head>
  3.     <title>AdvHTTP Component (Post Method)</title>
  4. </head>
  5. <body>
  6. <%
  7. dim HTTP
  8. set HTTP = Server.CreateObject("AdvHTTP.HTTP")
  9.     HTTP.ProxyServer = Request.Form("ProxyServer")
  10.     HTTP.ProxyPort = Request.Form("ProxyPort")
  11.     HTTP.Path = Request.Form("Path")' path at which you want to save return data
  12.     HTTP.SaveToFile = Request.Form("SaveToFile")' file name to be saved
  13.     'HTTP.Protocol = ""
  14.     'HTTP.Referrer = "Advanced Communications"
  15.  
  16.     'multiple form fields
  17.     HTTP.FormField Request.Form("FormFieldName"), Request.Form("FormFieldValue")
  18.     'you can specify more form fields to be post
  19.     
  20.     'multiple url fields
  21.     HTTP.URLField Request.Form("URLFieldName"), Request.Form("URLFieldValue")
  22.     'you can specify more url fields to be post
  23.     
  24.     'multiple files
  25.     HTTP.File Request.Form("FilePostName"), Request.Form("FilePost")
  26.     'you can specify more files to be post
  27.     
  28.     HTTP.URL = Request.Form("URL") 'perform post method on this URL
  29.     set Result = HTTP.Post()
  30.     if (HTTP.IsError = 1) then
  31.         Response.Write "Error: " & HTTP.ErrorReason & "<br>"
  32.     else
  33.         Response.Write "MimeType: " & Result.MimeType & "<br>" & "Header: " & Result.Header & "<br>" & "FileContent: " & Result.FileContent & "<br>"
  34.     end if
  35. set Result = Nothing
  36. set HTTP = Nothing
  37. %>
  38. </body>
  39. </html>
  40.