다음을 통해 공유


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>

참고하십시오