Package google.registry.tools
Class ServiceConnection
java.lang.Object
google.registry.tools.ServiceConnection
An HTTP connection to a service.
By default - connects to the TOOLS service in GAE and the BACKEND service in GKE. To create a
Connection to another service, call the withService(google.registry.request.Action.Service, boolean)
function.
-
Field Summary
Modifier and TypeFieldDescriptionprotected static final com.google.re2j.Pattern
Pattern to heuristically extract title tag contents in HTML responses. -
Method Summary
Modifier and TypeMethodDescriptionsendGetRequest
(String endpoint, Map<String, ?> params) sendPostRequest
(String endpoint, Map<String, ?> params, com.google.common.net.MediaType contentType, byte[] payload) withService
(Action.Service service, boolean useCanary) Returns a copy of this connection that talks to a different service endpoint.
-
Field Details
-
HTML_TITLE_TAG_PATTERN
protected static final com.google.re2j.Pattern HTML_TITLE_TAG_PATTERNPattern to heuristically extract title tag contents in HTML responses.
-
-
Method Details
-
withService
Returns a copy of this connection that talks to a different service endpoint. -
sendPostRequest
public String sendPostRequest(String endpoint, Map<String, ?> params, com.google.common.net.MediaType contentType, byte[] payload) throws IOException- Throws:
IOException
-
sendGetRequest
- Throws:
IOException
-
sendJson
- Throws:
IOException
-