Skip to content

Commit 7663bc1

Browse files
committed
Update README.md
1 parent b66854e commit 7663bc1

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

README.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -33,20 +33,20 @@ const {Session} = require('@chriscdn/cs-rest')
3333

3434
// session wraps an axios instance
3535
const session = new Session({
36-
baseURL: 'https://...cs.exe',
36+
baseURL: 'https://.../cs.exe',
3737
username: 'Admin',
3838
password: '******'
3939
})
4040

41-
// session can issue authenticated requests to Content Server
41+
// a Session instance can issue authenticated requests to Content Server
4242
const response = await session.get('/api/v1/nodes/2000')
4343
```
4444

45-
Authenticating with an `OTCSTicket`:
45+
Authenticate with an `OTCSTicket`:
4646

4747
```js
4848
const session = auth({
49-
baseURL: 'https://...cs.exe',
49+
baseURL: 'https://.../cs.exe',
5050
otcsticket: '<token>'
5151
})
5252
```
@@ -55,11 +55,11 @@ const session = auth({
5555

5656
Requests can be made with the `get`, `post`, `put`, `patch`, `delete`, and `options` methods on the `Session` instance. These have the same interface as the respective methods in [axios](https://github.com/axios/axios).
5757

58-
Content Server returns a fresh `OTCSTicket` with each successful API call. The `Session` instance will automatically use that token for the subsequent request.
58+
Content Server returns a fresh `OTCSTicket` with each successful API call. The `Session` instance will automatically retain it for the subsequent request.
5959

6060
#### POST, PUT, & PATCH
6161

62-
The OpenText Content Server REST API doesn't accept requests that use the `application/json` content type. This means POST, PUT, & PATCH requests need to use a content type of `multipart/form-data`, which makes writing the request a little more verbose. For example, to create a new folder:
62+
The OpenText Content Server REST API doesn't accept requests that use the `application/json` content type. This means POST, PUT, & PATCH requests need to use a content type of `multipart/form-data`, which makes writing the request a little verbose. For example, to create a new folder:
6363

6464
```js
6565
const formData = new FormData()
@@ -70,7 +70,7 @@ formDAta.append('name', 'My New Folder')
7070
const response = await session.post('api/v2/nodes', formData)
7171
```
7272

73-
The `Session` class provies a `postForm` (and similarily `putForm` and `patchForm`) method to simplify the above to:
73+
The `Session` class provides a `postForm` (also `putForm` and `patchForm`) method to simplify this to:
7474

7575
```js
7676
const response = await session.postForm('api/v2/nodes', {
@@ -90,17 +90,17 @@ const axios = session.axios
9090

9191
#### Thin Wrapper
9292

93-
The `Session` class provides a few convenience methods for performing commonly used REST requests. By no means is this complete, and it's also possible the API will change in the future.
93+
The `Session` class provides a few convenience methods for performing commonly used REST requests. By no means is this complete, and it's possible the API will change in the future.
9494

9595
For example, there is a method for creating a new folder:
9696

9797
```js
9898
const response = await session.nodes.addFolder(2000, 'My New Folder')
9999
```
100100

101-
A convenient method exists for uploading a document, where `file` is either:
101+
A method also exists for uploading a document, where `file` is either:
102102

103-
- a browser File object (e.g,. from drag and drop); or
103+
- a browser [File](https://developer.mozilla.org/en-US/docs/Web/API/File) object (e.g,. from drag and drop); or
104104
- a Node.js file (e.g., `const file = fs.readFileSync('<file path>')`
105105

106106
```js

0 commit comments

Comments
 (0)