The DeviceAtlas Carrier documentation
|
Public Member Functions | |
Properties | GetProperties (HttpRequest request) |
Get the Carrier properties for the given HttpWebRequest object. The most suitable client IP is extracted and used to lookup the Carrier properties. More... | |
Property | GetProperty (HttpRequest request, string propertyName) |
Properties | GetProperties () |
Get the Carrier properties for the current client. The most suitable client IP is extracted and used to lookup the Carrier properties. More... | |
Properties | GetProperties (HttpRequest request) |
Get the Carrier properties for the given HttpWebRequest object. The most suitable client IP is extracted and used to lookup the Carrier properties. More... | |
Property | GetProperty (string propertyName) |
Property | GetProperty (HttpRequest request, string propertyName) |
![]() | |
CarrierApi () | |
Construct a Carrier API object More... | |
CarrierApi (string path) | |
Construct a Carrier API object and Load the data file from the provided path. More... | |
string | GetDeviceAtlasApiVersion () |
Get CarrierApi version. More... | |
virtual void | DownloadAndLoadDataFile (DataFileConfig dataFileConfig) |
Downloads and loads the DeviceAtlas carrier detection data into the API. The data file is downloaded from the DeviceAtlas web-site. More... | |
virtual void | DownloadAndLoadDataFile (string dataFileDownloadUrl) |
Downloads and loads the DeviceAtlas carrier detection data into the API. The data file is downloaded from the DeviceAtlas web-site. More... | |
void | LoadDataFromFile (string path) |
Load the data file from the provided path. The data file is reloaded every time this method is called. More... | |
string | GetDataFileCopyright () |
Returns the data file copyright text. More... | |
string | GetDataFileCreationDate () |
Returns the data file creation date in ISO8601 format. More... | |
string | GetDataFileVersion () |
Returns the version of the data file. More... | |
Properties | GetProperties (string ipv4) |
Get the Carrier properties for a given IP address. More... | |
Properties | GetProperties (Dictionary< string, string > keyVals) |
Property | GetProperty (string ipv4, string propertyName) |
Property | GetProperty (Dictionary< string, string > keyVals, string propertyName) |
ReadOnlyCollection< PropertyName > | GetPropertyNames () |
A set of all the possible property names. The Set contains PropertyName objects that each have a string name and an associated data type. More... | |
string | GetIp (Dictionary< string, string > keyVals) |
Get the most suitable IP address from the given keyVals set of HTTP headers. This function checks the headers defined in HEADERS_TO_CHECK. More... | |
string | ExtractIp (string headerName, string headerValue) |
Additional Inherited Members | |
![]() | |
static string | GetApiVersion () |
Get CarrierApi version. More... | |
static bool | IsPublicIp (string ipStr) |
An IP address is considered public if it is not in any of the following ranges: More... | |
![]() | |
static readonly string | API_VERSION = "1.3" |
static readonly string [] | HEADERS_TO_CHECK |
A list of HTTP headers to choose the original client IP address from. In addition to these the RemoteAddr (REMOTE_ADDR) is also used as a final fallback. More... | |
A small extension to the core CarrierApi to get IP from HttpRequest for current client or permit passing of an HttpRequest object.
The GetProperties() and GetProperty() methods in this class extract the most suitable client IP.
Example usage:
|
inline |
|
inline |
|
inline |
|
inline |
Get a specific Property from the IP found in the HttpWebRequest object. The most suitable client IP is extracted from the HttpWebRequest object.
Note: if multiple properties are needed for the same IP it is more efficient to call GetProperties() once than repeated calls to GetProperty().
request | The request object to find the most suitable IP from. |
property | Name The name of the property to return |
InvalidPropertyNameException | Thrown if the property name does not exist. |
|
inline |
Get a specific Property from the current client IP found. The most suitable client IP is extracted from the HttpWebRequest object.
Note: if multiple properties are needed for the same IP it is more efficient to call GetProperties() once than repeated calls to GetProperty().
property | Name The name of the property to return |
InvalidPropertyNameException | Thrown if the property name does not exist. |
|
inline |
Get a specific Property from the IP found in the HttpWebRequest object. The most suitable client IP is extracted from the HttpWebRequest object.
Note: if multiple properties are needed for the same IP it is more efficient to call GetProperties() once than repeated calls to GetProperty().
request | The request object to find the most suitable IP from. |
property | Name The name of the property to return |
InvalidPropertyNameException | Thrown if the property name does not exist. |