Skip to content

Commit 11ed0ad

Browse files
author
Jamie Hannaford
committed
Add example outputs
1 parent af23542 commit 11ed0ad

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

docs/userguide/Clients.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,20 +120,28 @@ $client->setDefaultOption('headers/X-Custom-Header', 'FooBar');
120120

121121
php-opencloud will send a default `User-Agent` header for every HTTP request, unless a custom value is provided by the end-user. The default header will be in this format:
122122

123-
> OpenCloud/xxx cURL/yyy PHP/zzz
123+
> User-Agent: OpenCloud/xxx cURL/yyy PHP/zzz
124124
125125
where `xxx` is the current version of the SDK, `yyy` is the current version of cURL, and `zzz` is the current PHP version. To override this default, you must run:
126126

127127
```php
128128
$client->setUserAgent('MyCustomUserAgent');
129129
```
130130

131+
which will result in:
132+
133+
> User-Agent: MyCustomUserAgent
134+
131135
If you want to set a _prefix_ for the user agent, but retain the default `User-Agent` as a suffix, you must run:
132136

133137
```php
134138
$client->setUserAgent('MyPrefix', true);
135139
```
136140

141+
which will result in:
142+
143+
> User-Agent: MyPrefix OpenCloud/xxx cURL/yyy PHP/zzz
144+
137145
where `$client` is an instance of `OpenCloud\OpenStack` or `OpenCloud\Rackspace`.
138146

139147
## 5. Other functionality

0 commit comments

Comments
 (0)