From c2888047b4d2a5cb302c0659cf79b47be6418b8c Mon Sep 17 00:00:00 2001 From: Stephanie Cheng Date: Fri, 21 Oct 2016 12:49:09 -0500 Subject: [PATCH] Updating documentation with information about custom service URLs and headers --- README.md | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/README.md b/README.md index 15d3deedb..8cfd84239 100644 --- a/README.md +++ b/README.md @@ -23,6 +23,8 @@ There are many resources to help you build your first cognitive application with * [Requirements](#requirements) * [Installation](#installation) * [Service Instances](#service-instances) +* [Custom Service URLs](#custom-service-urls) +* [Custom Headers](#custom-headers) * [Sample Applications](#sample-applications) * [Xcode 8 Compatibility](#xcode-8-compatibility) * [Xcode 7 Compatibility](#xcode-7-compatibility) @@ -129,6 +131,27 @@ Note that service credentials are different from your Bluemix username and passw See [Getting Started](https://www.ibm.com/watson/developercloud/doc/getting_started/) for more information on getting started with the Watson Developer Cloud and Bluemix. +## Custom Service URLs + +In some instances, users will need to use their own custom URL to access the Watson services. Thus, to make it easier to update, we have exposed the service URL as a public property of each class. + +You can set a custom service URL like so: + +```swift +let dialog = Dialog(username: "your-username-here", password: "your-password-here") +dialog.serviceURL = "your-custom-service-url" +``` + +## Custom Headers +There are different headers that can be sent to the Watson services. For example, Watson services log requests and their results for the purpose of improving the services, but you can include the `X-Watson-Learning-Opt-Out` header to opt out of this. + +We have exposed a `defaultHeaders` public property in each class to allow users to easily customize their headers: + +```swift +let naturalLanguageClassifier = NaturalLanguageClassifier(username: username, password: password) +naturalLanguageClassifier.defaultHeaders = ["X-Watson-Learning-Opt-Out": "true"] +``` + ## Sample Applications * [Simple Chat (Objective-C)](https://github.com/watson-developer-cloud/simple-chat-objective-c)