Which interface would you use to register a service dynamically using standard tools like 'curl'?
The HTTP API exposes REST endpoints that accept service definitions via PUT requests, so standard tools like curl can register services without installing the Consul CLI or agents. This directly satisfies the stem's requirement for dynamic registration using generic HTTP clients rather than Consul-specific tooling.
Why this answer
The HTTP API is the primary programmatic interface for Consul and exposes RESTful endpoints such as PUT /v1/agent/service/register, which can be invoked with standard tools like curl. This makes it the correct choice for dynamically registering a service without using the CLI or configuration files. The DNS interface is read-only for service discovery, and gossip is an internal membership protocol, not a registration mechanism.
How to eliminate wrong answers
Option B is wrong because the DNS interface only resolves service names to IP addresses and cannot register or modify services. Option C is wrong because the gossip protocol is used for Serf-based cluster membership and failure detection, not for service registration. Option D is wrong because the CLI agent command (e.g., consul services register) is a wrapper around the HTTP API and is not the interface itself; the question asks for the interface usable with standard tools like curl.