Skip to content

Commit c8daf83

Browse files
authored
Merge pull request #58 from julbrs/feature/update-readme
docs: update README to include request options and usage examples
2 parents 27d0b02 + 96eea2a commit c8daf83

1 file changed

Lines changed: 23 additions & 0 deletions

File tree

README.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,15 @@ const client = new NetsuiteApiClient({
3434

3535
## request
3636

37+
`request` accepts the following options:
38+
39+
- `path` (optional): REST path under `/services/rest/`.
40+
- `restletUrl` (optional): full URL for RESTlet calls (bypasses `path` URL building).
41+
- `method` (optional): HTTP method, defaults to `GET`.
42+
- `body` (optional): request body as a string.
43+
- `heads` (optional): additional headers.
44+
- `overrides` (optional): raw `got` request options (`OptionsOfTextResponseBody`) merged into the internal defaults.
45+
3746
### Test
3847

3948
```ts
@@ -58,6 +67,20 @@ client
5867
.catch((err) => console.log(err));
5968
```
6069

70+
### Override got options
71+
72+
Use `overrides` when you need to pass advanced `got` options (for example timeout/retry).
73+
74+
```ts
75+
client.request({
76+
path: "record/v1/customer/",
77+
overrides: {
78+
timeout: { request: 15000 },
79+
retry: { limit: 0 },
80+
},
81+
});
82+
```
83+
6184
## query
6285

6386
```ts

0 commit comments

Comments
 (0)