You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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).
57
57
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.
59
59
60
60
#### POST, PUT, & PATCH
61
61
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:
63
63
64
64
```js
65
65
constformData=newFormData()
@@ -70,7 +70,7 @@ formDAta.append('name', 'My New Folder')
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.
94
94
95
95
For example, there is a method for creating a new folder:
96
96
97
97
```js
98
98
constresponse=awaitsession.nodes.addFolder(2000, 'My New Folder')
99
99
```
100
100
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:
102
102
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
104
104
- a Node.js file (e.g., `const file = fs.readFileSync('<file path>')`
0 commit comments