DNSimple.DNSimpleRestClient.RegisterDomain C# (CSharp) Méthode

RegisterDomain() public méthode

Register a domain name with DNSimple and the appropriate domain registry. Makes a POST request to the Domain Registrations resource (domain_registrations).
Your account must already be active for this command to complete successfully. You will be automatically charged the 1 year registration fee upon successful registration, so please be careful with this command.
public RegisterDomain ( string name, int registrant_id ) : dynamic
name string The domain name to register
registrant_id int ID for an existing account contact
Résultat dynamic
        public dynamic RegisterDomain(string name, int registrant_id)
        {
            Require.Argument("name", name);
            Require.Argument("registrant_id", registrant_id);

            var request = new RestRequest(Method.POST)
            {
                RequestFormat = DataFormat.Json,
                Resource = "domain_registrations"
            };

            dynamic payload = new ExpandoObject();
            payload.domain = new
            {
                name = name,
                registrant_id = registrant_id
            };

            request.AddBody(payload);

            return Execute<dynamic>(request);
        }