Client for communicating with EPP services
Add this line to your application's Gemfile:
gem 'epp-client'
And then execute:
$ bundle
Or install it yourself as:
$ gem install epp-client
client = EPP::Client.new('username', 'password', 'epp.server.com')
client.hello
puts client._last_request.inspect
puts client._last_response.inspect
Any other methods called on client
will be passed through to an
authenticated EPP server connection. As a quick example, either a
string of XML, an XML::Node or XML::Document can be passed or a
block may be used
client.check <<-EOXML
<domain:check
xmlns:domain="urn:ietf:params:xml:ns:domain-1.0">
<domain:name>example.com</domain:name>
<domain:name>example.net</domain:name>
<domain:name>example.org</domain:name>
</domain:check>
EOXML
xml = XML::Node.new('check')
ns = XML::Namespace.new(xml, 'domain', 'urn:ietf:params:xml:ns:domain-1.0')
xml.namespaces.namespace = ns
%w(example.com example.net example.org).each do |name|
xml << XML::Node.new('name', name, ns)
end
client.check xml
client.check do |xml|
xml << (check = XML::Node.new('check'))
ns = XML::Namespace.new(check, 'domain', 'urn:ietf:params:xml:ns:domain-1.0')
check.namespaces.namespace = ns
%w(example.com example.net example.org).each do |name|
check << XML::Node.new('name', name, ns)
end
end
If you leave off the block parameter then the return value of the block will be
inserted into the xml
.
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Added some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request