From 95fecd04bbacb670faeffa3a4972f57b6a0a5d9a Mon Sep 17 00:00:00 2001 From: Daniel Azuma Date: Mon, 24 Jun 2019 13:18:22 -0700 Subject: [PATCH] Add a section in the readme documenting how to change the root_url (#805) --- README.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/README.md b/README.md index 01ac3fca2..70e4d1fc6 100644 --- a/README.md +++ b/README.md @@ -287,6 +287,22 @@ To set the logging level for the client: Google::Apis.logger.level = Logger::DEBUG ``` +## Customizing endpoints + +By default, client objects will connect to the default Google endpoints for = +their respective APIs. If you need to connect to a regional endpoint, a test +endpoint, or other custom endpoint, modify the `root_url` attribute of the +client object. For example: + +```ruby +require "google/apis/docs_v1" +docs_service = Google::Apis::DocsV1::DocsService.new + +docs_service.root_url = "https://my-custom-docs-endpoint.example.com/" + +document = docs_service.get_document("my-document-id") +``` + ## Samples See the [samples](https://github.com/google/google-api-ruby-client/tree/master/samples) for examples on how to use the client library for various