Package google.registry.tools
Class ServiceConnection
- java.lang.Object
-
- google.registry.tools.ServiceConnection
-
public class ServiceConnection extends java.lang.Object
An HTTP connection to a service.By default - connects to the TOOLS service. To create a Connection to another service, call the
withService(google.registry.request.Action.Service)
function.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.net.URL
getServer()
java.lang.String
sendGetRequest(java.lang.String endpoint, java.util.Map<java.lang.String,?> params)
java.util.Map<java.lang.String,java.lang.Object>
sendJson(java.lang.String endpoint, java.util.Map<java.lang.String,?> object)
java.lang.String
sendPostRequest(java.lang.String endpoint, java.util.Map<java.lang.String,?> params, com.google.common.net.MediaType contentType, byte[] payload)
ServiceConnection
withService(Action.Service service)
Returns a copy of this connection that talks to a different service.
-
-
-
Method Detail
-
withService
public ServiceConnection withService(Action.Service service)
Returns a copy of this connection that talks to a different service.
-
sendPostRequest
public java.lang.String sendPostRequest(java.lang.String endpoint, java.util.Map<java.lang.String,?> params, com.google.common.net.MediaType contentType, byte[] payload) throws java.io.IOException
- Throws:
java.io.IOException
-
sendGetRequest
public java.lang.String sendGetRequest(java.lang.String endpoint, java.util.Map<java.lang.String,?> params) throws java.io.IOException
- Throws:
java.io.IOException
-
sendJson
public java.util.Map<java.lang.String,java.lang.Object> sendJson(java.lang.String endpoint, java.util.Map<java.lang.String,?> object) throws java.io.IOException
- Throws:
java.io.IOException
-
getServer
public java.net.URL getServer()
-
-