Add a section in the readme documenting how to change the root_url (#805)

This commit is contained in:
Daniel Azuma 2019-06-24 13:18:22 -07:00 committed by GitHub
parent cd99d79852
commit 95fecd04bb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 16 additions and 0 deletions

View File

@ -287,6 +287,22 @@ To set the logging level for the client:
Google::Apis.logger.level = Logger::DEBUG 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 ## 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 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