Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. Web Development
  3. HTTP Request Forwarding in Classic ASP

HTTP Request Forwarding in Classic ASP

Scheduled Pinned Locked Moved Web Development
helpcsharpsysadminsecurityjson
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    Mr Jen Withers
    wrote on last edited by
    #1

    Hey - Iam not sure if this is even possible with the limited API in classic ASP, but I need to find a way to forward a HTTP post request to a given URL. I need to do this to avoid a cross domain scripting issue where I cant get the target users to change their security settings. The client server is using IIS5 on windows2000 server so iam assuming I have no .net. The only other way of achieve this task instead of using classic ASP or .net is to use a console style CGI maybe - but id rather not rely on this! Thanks for any help in advance - Mike

    J S 2 Replies Last reply
    0
    • M Mr Jen Withers

      Hey - Iam not sure if this is even possible with the limited API in classic ASP, but I need to find a way to forward a HTTP post request to a given URL. I need to do this to avoid a cross domain scripting issue where I cant get the target users to change their security settings. The client server is using IIS5 on windows2000 server so iam assuming I have no .net. The only other way of achieve this task instead of using classic ASP or .net is to use a console style CGI maybe - but id rather not rely on this! Thanks for any help in advance - Mike

      J Offline
      J Offline
      JimmyRopes
      wrote on last edited by
      #2

      You can propagate the post parameters into some hidden form fields (using server side scripting) of a form with an action specifying the target URL and submit the form in an onload event.

      Simply Elegant Designs JimmyRopes Designs
      Think inside the box! ProActive Secure Systems
      I'm on-line therefore I am. JimmyRopes

      1 Reply Last reply
      0
      • M Mr Jen Withers

        Hey - Iam not sure if this is even possible with the limited API in classic ASP, but I need to find a way to forward a HTTP post request to a given URL. I need to do this to avoid a cross domain scripting issue where I cant get the target users to change their security settings. The client server is using IIS5 on windows2000 server so iam assuming I have no .net. The only other way of achieve this task instead of using classic ASP or .net is to use a console style CGI maybe - but id rather not rely on this! Thanks for any help in advance - Mike

        S Offline
        S Offline
        Spiff Dog
        wrote on last edited by
        #3

        If you are talking about having the server forward a post request, you may be able to do something like this. My VBScript is kinda rusty, so expect a bug or two: <% Dim postData Dim xmlhttp 'sample form-POST data postData = "data=100" 'setup form post object 'we use the XML HTTP object Set xmlhttp = server.CreateObject("MSXML2.ServerXMLHTTP") 'replace with the server you would like to post to 'make sure "POST" is capitalized xmlhttp.Open "POST","http://my.target.server/target.asp",false 'set header with Content-Type rule for a typical form post xmlhttp.setRequestHeader "Content-Type", "application/x-www-form-urlencoded" 'send data in key=value pairs xmlhttp.send(dataToSend) 'write out return response from POST Response.Write xmlhttp.responseXml.xml 'destroy the http object Set xmlhttp = nothing %> If you are talking about just taking the browser post point to a differant location, if it's the same server, just use: Server.Transfer ("newlocation.asp", true)

        -------------------------
        Spiffdog Design
        It's ok.. he's no ordinary dog...

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups