简体   繁体   中英

How can I see what file was sent to my website via POST?

I have an IIS 7 server and a website that accepts XML POSTs. When I design it in my test environment I can set a break point and walk thru and see what is POSTed. But when I upload the code to the server and someone posts an XML they get no response and I cannot see anything on my end to debug why.

What I would like is to see the contents of his POST. Should I se my website to write a log file or is there somewhere in IIS7 I should be looking?

I am using .Net and not PHP.

Any ideas?

protected void Page_Load(object sender, EventArgs e)
    {
        Page.Response.ContentType = "text/xml";
        System.IO.StreamReader reader = new System.IO.StreamReader ( Page.Request.InputStream );
        String xmlData = reader.ReadToEnd ();
        System.IO.StreamWriter SW;
        SW = File.CreateText ( Server.MapPath(".")+@"\"+ Guid.NewGuid () + ".xml" );
        SW.WriteLine ( xmlData );
        SW.Close ();
    }

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM