Share via


My.Request (Objeto)

Obtiene el objeto HttpRequest para la página solicitada.

Comentarios

Objeto My.Request que contiene información sobre la solicitud HTTP actual.

El objeto My.Request solo está disponible para las aplicaciones ASP.NET.

Ejemplo

En el ejemplo siguiente, se obtiene la colección de encabezados del objeto My.Request y se usa el objeto My.Response para escribirla en la página 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>

Consulte también