Skip to content

HTTPRequest

Source code in docs_src/capo_waf/types/http_request.py
class HTTPRequest(TypedDict, closed=True):
    client_ip: NotRequired["capo_waf.types.ip_string.IPString"]
    """<p>The IP address that the request originated from. If the <code>WebACL</code> is associated with a CloudFront distribution, this is the value of one of the following fields in CloudFront access logs:</p> <ul> <li> <p> <code>c-ip</code>, if the viewer did not use an HTTP proxy or a load balancer to send the request</p> </li> <li> <p> <code>x-forwarded-for</code>, if the viewer did use an HTTP proxy or a load balancer to send the request</p> </li> </ul>"""
    country: NotRequired["capo_waf.types.country.Country"]
    """<p>The two-letter country code for the country that the request originated from. For a current list of country codes, see the Wikipedia entry <a href="https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2">ISO 3166-1 alpha-2</a>.</p>"""
    uri: NotRequired["capo_waf.types.uri_string.URIString"]
    """<p>The part of a web request that identifies the resource, for example, <code>/images/daily-ad.jpg</code>.</p>"""
    method: NotRequired["capo_waf.types.http_method.HTTPMethod"]
    """<p>The HTTP method specified in the sampled web request. CloudFront supports the following methods: <code>DELETE</code>, <code>GET</code>, <code>HEAD</code>, <code>OPTIONS</code>, <code>PATCH</code>, <code>POST</code>, and <code>PUT</code>. </p>"""
    http_version: NotRequired["capo_waf.types.http_version.HTTPVersion"]
    """<p>The HTTP version specified in the sampled web request, for example, <code>HTTP/1.1</code>.</p>"""
    headers: NotRequired["capo_waf.types.http_headers.HTTPHeaders"]
    """<p>A complex type that contains two values for each header in the sampled web request: the name of the header and the value of the header.</p>"""

client_ip instance-attribute

client_ip: NotRequired[IPString]

The IP address that the request originated from. If the WebACL is associated with a CloudFront distribution, this is the value of one of the following fields in CloudFront access logs:

  • c-ip, if the viewer did not use an HTTP proxy or a load balancer to send the request

  • x-forwarded-for, if the viewer did use an HTTP proxy or a load balancer to send the request

country instance-attribute

country: NotRequired[Country]

The two-letter country code for the country that the request originated from. For a current list of country codes, see the Wikipedia entry ISO 3166-1 alpha-2.

headers instance-attribute

headers: NotRequired[HTTPHeaders]

A complex type that contains two values for each header in the sampled web request: the name of the header and the value of the header.

http_version instance-attribute

http_version: NotRequired[HTTPVersion]

The HTTP version specified in the sampled web request, for example, HTTP/1.1.

method instance-attribute

method: NotRequired[HTTPMethod]

The HTTP method specified in the sampled web request. CloudFront supports the following methods: DELETE, GET, HEAD, OPTIONS, PATCH, POST, and PUT.

uri instance-attribute

uri: NotRequired[URIString]

The part of a web request that identifies the resource, for example, /images/daily-ad.jpg.