Tough low-level HTTP header question in IIS

Results 1 to 6 of 6

Thread: Tough low-level HTTP header question in IIS

  1. #1
    PratQ Guest

    Default Tough low-level HTTP header question in IIS

    I have been playing around for a long time for a solution to POSTing to another ASP page from an ASP page. Basicly trying to figure out a way to Redirect taking my posted data with me.<BR><BR>I keep thinking that there may be a way to manipulate the headers using ADDHEADER method in ASP to forward the POST on to another ASP page. But none of my experiments have worked so far. <BR><BR>Its too easy to just say it wont work, I would like to understand why. So I went into to W3 archives and pulled out the MetaInformation guide on how HTTP headers are passed.<BR><BR>Whenever a request is sent from client to server, a series of headers are passed to describe content, types of Allowed commands, content-length, content-type, etc. Once on the server I can grab the entire header and manipulate it directly. This got me thinking that I should be able to add this same header back into the response header.<BR><BR>What I would like to know is when a Response.Redirect is issued what is actually happening? My understanding is the server sends the client a redirect command, and the client performs another GET to the URL. <BR><BR>If I manipulate the header coming from the server, does it get passed back to the client when using redirect? If it does get passed back to the client, would the client redirect using that header? <BR><BR>Or is my whole assumption-base off?<BR><BR>Any information about how headers are built and passed in both client and server scenarios would be helpful. Or any links to How-to articles.<BR><BR>Any ideas?

  2. #2
    Anthony Meehan Guest

    Default RE: Tough low-level HTTP header question in IIS

    Hi,<BR><BR>The Response.Redirect sends a 302 page to the browser which tells it where the new page resides.<BR><BR>I tried the following ASP page:<BR><BR>&#060;%@ Language=VBScript%&#062;<BR>&#060;%<BR><BR>Respons e.AddHeader "HeaderName", "HeaderValue"<BR>Response.Redirect ""<BR><BR>%&#062;<BR><BR>And the response from IIS is as follows:<BR><BR>HTTP/1.1 302 Object moved<BR>Server: Microsoft-IIS/4.0<BR>Date: Wed, 11 Oct 2000 21:20:36 GMT<BR>HeaderName: HeaderValue<BR>Location:<BR>Content-Type: text/html<BR>Set-Cookie: ASPSESSIONIDQQGQQGPV=COHPJMGCADKIAGFEMILFDLOE; path=/<BR>Cache-control: private<BR> <BR>&#060;head&#062;&#060;title&#062;Object moved&#060;/title&#062;&#060;/head&#062;<BR> &#060;body&#062;&#060;h1&#062;Object Moved&#060;/h1&#062;This object m<BR>ay be found &#060;a HREF=""&#062;here&#060;/a&#062;.&#060;/body&#062;<BR><BR><BR><BR>As you can see, the Headers are included. However, the browser is just going to make another GET request to the server. Therefore I suggest you use the following ASP page:<BR><BR>&#060;%@ Language=VBScript%&#062;<BR>&#060;html&#062;<BR>&# 060;head&#062;&#060;/head&#062;<BR>&#060;body onload="document.forms[0].submit()"&#062;<BR>&#060;form action="NEW_ASP_PAGE_GOES_HERE" method="post"&#062;<BR>&#060;%<BR>For Each strField in Request.Form<BR>%&#062;<BR>&#060;input type="hidden" name="&#060;%= strField %&#062;" value="&#060;%= Request.Form(strField) %&#062;"&#062;<BR>&#060;%<BR>Next<BR>%&#062;<BR>&# 060;/form&#062;<BR>&#060;/body&#062;<BR>&#060;/html&#062;<BR><BR><BR>Hope this helps.

  3. #3
    John M. Guest

    Default RE: Tough low-level HTTP header question in IIS

    How did you get the raw response from IIS? I&#039m trying to debug a download problem i&#039m having and need to get my hands on the raw response text (i.e. HTTP 1.1....).<BR><BR>Thanks!<BR>

  4. #4
    PratQ Guest

    Default Thanks!

    Thanks for the detail. I have used your solution before, but I was hoping I could cut down on bandwidth from client to server by not sending everything to the browser again. Of course, since the header is being sent to the browser, it would be pretty much the same bytestream length anyhow. So even if I could manipulate the headers it would only save me a few bytes.<BR><BR>I guess my thinking was off on this one, but I appreciate the dump of the header. I would like to be able to do that. Are you using a specific tool to view the header coming back from the server or some sort of script? If a tool, which one? It seems I remeber one a long time ago, but cant remember what it was called.<BR><BR>Thanks again.<BR><BR>

  5. #5
    Chrace Guest

    Default Another solution, not using POST

    Question was to response.redirect and keep the data, no?<BR><BR>Response.Redirect("NewAspPage.asp?parm1 =" & parm1 & "&parm2...<BR><BR>That would keep it serverside and the client wouldn&#039t see it as GET either.

  6. #6
    Curtis Batt Guest

    Default RE: Tough low-level HTTP header question in IIS

    Dang... I just posted a question about this. I should&#039ve read the board a bit more carefully.<BR><BR>Anyhoo... I&#039m in the same boat. I&#039ve been trying to bend my head around this for quite some time and it apparently looks grim.<BR><BR>Here&#039s what I&#039m thinking of doing now:<BR><BR>User requests form_page.asp<BR><BR>form_page.asp checks for a certain default value intDefaultValue at the top of the page:<BR><BR>If intDefaultValue = "" Then<BR> Response.Redirect("process_page.asp?action=SET_DEF AULT")<BR><BR>process_page.asp, executes the SET_DEFAULTS code<BR><BR>as soon as SET_DEFAULT is finished, instead of sending the user back to form_page.asp:<BR><BR>Server.Execute(" p")<BR><BR>when form_page.asp executes inside of process_page.asp, intDefaultValue will have a value and pass the initial validation<BR><BR>Of course, this "solution" implies that maybe form_page.asp and process_page.asp should be rolled into a single file anyways.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts