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
  1. Home
  2. Web Development
  3. ASP.NET
  4. Display the HTTP POST/GET string on the page

Display the HTTP POST/GET string on the page

Scheduled Pinned Locked Moved ASP.NET
helpquestionsysadmintutorial
5 Posts 3 Posters 1 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.
  • A Offline
    A Offline
    Andre Sanches alvs
    wrote on last edited by
    #1

    First off, my apologies for my poor english. I've already looked everywhere to find this piece of info by myself, now I humbly come in seek of help from the gurus on this board - please help this lowly desperate developer :) The million-dollar question is: is it possible to display in a page (with Response.Write() for instance) the original HTTP get/post command the browser used to open it? For example, if I connect to my local server via telnet and issue a "GET /default.aspx" command, I need the page to output this exact command so that the end user can see what was requested. Thanks a lot in advance! Unix is user-friendly. It's just picky about its friends!

    P 1 Reply Last reply
    0
    • A Andre Sanches alvs

      First off, my apologies for my poor english. I've already looked everywhere to find this piece of info by myself, now I humbly come in seek of help from the gurus on this board - please help this lowly desperate developer :) The million-dollar question is: is it possible to display in a page (with Response.Write() for instance) the original HTTP get/post command the browser used to open it? For example, if I connect to my local server via telnet and issue a "GET /default.aspx" command, I need the page to output this exact command so that the end user can see what was requested. Thanks a lot in advance! Unix is user-friendly. It's just picky about its friends!

      P Offline
      P Offline
      pmarfleet
      wrote on last edited by
      #2

      The HttpMethod and RequestType properties of the Request object will tell you what HTTP verb was used to make the request. You can get the request URL by querying the Url property of the Request object.

      Paul Marfleet

      A 1 Reply Last reply
      0
      • P pmarfleet

        The HttpMethod and RequestType properties of the Request object will tell you what HTTP verb was used to make the request. You can get the request URL by querying the Url property of the Request object.

        Paul Marfleet

        A Offline
        A Offline
        Andre Sanches alvs
        wrote on last edited by
        #3

        Thanks for the quick reply on this, but that's not exactly what I'm looking for. Here's what I'm trying to accomplish: When the user reaches the default document on my website (default.aspx), I need to detect whether he used just the domain name (e.g. www.mysite.com) or if he also included the name of the file (e.g. www.mysite.com/default.aspx). I've been digging so deep into this I got bits stuck under my nails, and this is really the only way I could think of accomplishing this task. I am wide open for suggestions though - in fact, they will be much appreciated.

        N 1 Reply Last reply
        0
        • A Andre Sanches alvs

          Thanks for the quick reply on this, but that's not exactly what I'm looking for. Here's what I'm trying to accomplish: When the user reaches the default document on my website (default.aspx), I need to detect whether he used just the domain name (e.g. www.mysite.com) or if he also included the name of the file (e.g. www.mysite.com/default.aspx). I've been digging so deep into this I got bits stuck under my nails, and this is really the only way I could think of accomplishing this task. I am wide open for suggestions though - in fact, they will be much appreciated.

          N Offline
          N Offline
          N a v a n e e t h
          wrote on last edited by
          #4

          Try to print Request.RawUrl, I guess this will give the URL visible on the address bar.

          Andre Luiz V Sanches wrote:

          I need to detect whether he used just the domain name (e.g. www.mysite.com) or if he also included the name of the file (e.g. www.mysite.com/default.aspx)

          This looks strange, why do you want to do this ?

          All C# applications should call Application.Quit(); in the beginning to avoid any .NET problems.- Unclyclopedia My Website | Ask smart questions

          A 1 Reply Last reply
          0
          • N N a v a n e e t h

            Try to print Request.RawUrl, I guess this will give the URL visible on the address bar.

            Andre Luiz V Sanches wrote:

            I need to detect whether he used just the domain name (e.g. www.mysite.com) or if he also included the name of the file (e.g. www.mysite.com/default.aspx)

            This looks strange, why do you want to do this ?

            All C# applications should call Application.Quit(); in the beginning to avoid any .NET problems.- Unclyclopedia My Website | Ask smart questions

            A Offline
            A Offline
            Andre Sanches alvs
            wrote on last edited by
            #5

            No luck, Request.RawUrl will print out the page name even if the user did not explicitly typed it in.

            N a v a n e e t h wrote:

            This looks strange, why do you want to do this ?

            it's a request from the SEO expert who's working with us. I wonder if there are any low-level IIS API calls I could use from within .NET to capture the exact HTTP command that was sent to the server. Any ideas?

            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