- Documentation
TrafficRoute DNS Suite
VolcanoEngine HTTPDNS
Client development guide
Use the client SDK
Best Practices
Add custom identifiers to AnyMatch functionality
Best Practices
Add custom identifiers to AnyMatch functionality
Add custom identifiers to AnyMatch functionality
Add custom identifiers in Android SDK
You can add custom identifiers for the AnyMatch feature for software-defined parsing in Android SDK version 1.0.22 or later.
- Import the AbsOptionalHttpDnsDepend abstract class.
- When initializing the Android SDK, inherit the AbsOptionalHttpDnsDepend abstract class and override the getExtraHeaders method or the getExtraQueryParams method. Then, you need to pass a custom identifier in the return value.
tip
- getExtraHeaders method sends a custom identifier via request headers; getExtraQueryParams method sends a custom identifier via query parameters. You can choose any one of these methods.
- You can add multiple custom identifiers in Am-Tag. The matching order is from left to right. For example, in headers.put("Am-Tag", Arrays.asList("hebei", "shijiazhuang")), the matching order is hebei and shijiazhuang.
Add custom identifiers in the iOS SDK
You can add custom identifiers for the software-defined parsing AnyMatch feature in iOS SDK version 0.13.1 or later.
When initializing the iOS SDK, before calling dnsResolverColdStart, call setHttpDnsCustomHeaderBlock or setHttpDnsCustomParamBlock to send a custom identifier. tip
- setHttpDnsCustomHeaderBlock method sends a custom identifier via the request header; setHttpDnsCustomParamBlock method sends a custom identifier via query parameters. You may choose any one of the methods.
- You can add multiple custom identifiers in the Am-Tag. The matching order is from left to right. For example, in "Am-Tag" : ["hebei", "shijiazhuang"], the matching order is hebei and shijiazhuang.
Last updated: 2025.11.04 21:10:49