HTTP API Toolkit HTTP API Toolkit
HTTP API Toolkit HTTP API Toolkit
DocFX + Singulink = ♥

Search Results for

    Class CloudflareClientLocation

    The visitor location that Cloudflare sends with a request, as Cloudflare provides it. Values that Cloudflare did not send are null.

    Inheritance
    object
    CloudflareClientLocation
    Namespace: Singulink.Net.Http.Api.Service
    Assembly: Singulink.Net.Http.Api.Service.Cloudflare.dll
    Syntax
    public sealed class CloudflareClientLocation
    Remarks

    Cloudflare sends CountryCode when IP geolocation is turned on for the zone, and the other values when its "Add visitor location headers" managed transform is turned on.

    Properties

    Name Description
    City

    Gets the name of the visitor's city, such as Toronto, from the CF-IPCity header.

    ContinentCode

    Gets the visitor's continent as a two-letter code, such as NA, from the CF-IPContinent header.

    CountryCode

    Gets the visitor's country as a two-letter ISO 3166-1 code, such as CA, from the CF-IPCountry header. Cloudflare sends XX when the country is unknown and T1 for the Tor network.

    Latitude

    Gets the visitor's approximate latitude, as Cloudflare writes it, from the CF-IPLatitude header.

    Longitude

    Gets the visitor's approximate longitude, as Cloudflare writes it, from the CF-IPLongitude header.

    MetroCode

    Gets the visitor's metro code (US only), from the CF-Metro-Code header.

    PostalCode

    Gets the visitor's postal code, from the CF-Postal-Code header.

    Region

    Gets the name of the visitor's region, such as Ontario, from the CF-Region header.

    RegionCode

    Gets the code of the visitor's region, such as ON, from the CF-Region-Code header.

    TimeZone

    Gets the name of the visitor's time zone, such as America/Toronto, from the CF-Timezone header.

    Methods

    Name Description
    ToString()

    Returns the visitor's city, region and country code, as far as Cloudflare sent them, separated by commas, such as Toronto, Ontario, CA. The country code XX, which Cloudflare sends for an unknown country, is left out. Returns an empty string if none of them is known.

    © Singulink. All rights reserved.