Link to home
Start Free TrialLog in
Avatar of tmostad
tmostad

asked on

How to create a site which dumps whatever HTML is sent to it?

There is a site (http://stevex.net/dump.php) which works with some demo code that came with a .NET control library I purchased. It harmlessly dumps whatever is sent to it. I am a net newbie and could use a pointer to some kind of tutorial or book that might explain how it works. I need to create something similar with ASP.NET.
Avatar of mikeutt
mikeutt

What you are looking at is a dump of the HTTP headers. They are like a set of instruction or requests the web browser sends to the web server. The web server looks at the headers and uses that to decide what to send back to the web browser.

http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html
http://www.w3.org/Protocols/rfc2616/rfc2616.html

Its really easy to do this in ASP.net

<%@ Page Language="C#" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<script runat="server">

    protected void Page_Load(object sender, EventArgs e)
    {
        Label1.Text = Request.ServerVariables["ALL_RAW"].Replace("\n","<br>");
    }
</script>

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>Untitled Page</title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <asp:Label ID="Label1" runat="server" Text="Label"/>
    </div>
    </form>
</body>
</html>

You can see this page at  http://www.mikeutterback.net/headers.aspx
Avatar of tmostad

ASKER

Thanks Mike. Your code does part of what this other site is doing. The library is a PDF Acroform library and the dump.php I think is parsing the attached Acroform and displaying it. Your code reports:

Cache-Control: no-cache
Connection: Keep-Alive
Content-Length: 215
Content-Type: application/x-www-form-urlencoded
Accept: */*
Host: www.mikeutterback.net 
User-Agent: AcroForms
Acrobat-Version: 8.1.0

I don't need to parse the form; saving it to some path on the server would be sufficient. Is it some kind of attachment or what? Or is it even possible to tell?
ASKER CERTIFIED SOLUTION
Avatar of netmunky
netmunky
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial