Share via


My.Request 개체

요청된 페이지에 대한 HttpRequest 개체를 가져옵니다.

설명

My.Request 개체에는 현재 HTTP 요청에 대한 정보가 포함됩니다.

My.Request 개체는 ASP.NET 애플리케이션에만 사용할 수 있습니다.

예시

다음 예에서는 My.Request 개체에서 헤더 컬렉션을 가져오고 My.Response 개체를 사용하여 ASP.NET 페이지에 씁니다.

<script runat="server">
    Public Sub ShowHeaders()
        ' Load the header collection from the Request object.
        Dim coll As System.Collections.Specialized.NameValueCollection
        coll = My.Request.Headers

        ' Put the names of all keys into a string array.
        For Each key As String In coll.AllKeys
            My.Response.Write("Key: " & key & "<br>")

            ' Get all values under this key.
            For Each value As String In coll.GetValues(key)
                My.Response.Write("Value: " & _
                    Server.HtmlEncode(value) & "<br>")
            Next
        Next
    End Sub
</script>

참고 항목