Skip to content

Commit

Permalink
chore: apply automated updates
Browse files Browse the repository at this point in the history
  • Loading branch information
autofix-ci[bot] authored Jun 23, 2024
1 parent 8685170 commit 54eaa5b
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 93 deletions.
26 changes: 0 additions & 26 deletions docs/2.utils/1.request.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,32 +25,6 @@ export default defineEventHandler((event) => {
});
```

### `getHeader(event, name)`

Get a request header by name.

**Example:**

```ts
export default defineEventHandler((event) => {
const contentType = getRequestHeader(event, "content-type"); // "application/json"
});
```

### `getHeaders(event)`

Get the request headers object.

Array headers are joined with a comma.

**Example:**

```ts
export default defineEventHandler((event) => {
const headers = getRequestHeaders(event); // { "content-type": "application/json", "x-custom-header": "value" }
});
```

### `getQuery(event)`

Get query the params object from the request URL parsed with [unjs/ufo](https://ufo.unjs.io).
Expand Down
66 changes: 0 additions & 66 deletions docs/2.utils/2.response.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,33 +8,6 @@ icon: material-symbols-light:output
<!-- automd:jsdocs src="../../src/utils/response.ts" -->

### `appendHeader(event, name, value)`

Append a response header by name.

**Example:**

```ts
export default defineEventHandler((event) => {
appendResponseHeader(event, "content-type", "text/html");
});
```

### `appendHeaders(event, headers)`

Append the response headers.

**Example:**

```ts
export default defineEventHandler((event) => {
appendResponseHeaders(event, {
"content-type": "text/html",
"cache-control": "no-cache",
});
});
```

### `appendResponseHeader(event, name, value)`

Append a response header by name.
Expand Down Expand Up @@ -78,18 +51,6 @@ export default defineEventHandler((event) => {

Set the response status code and message.

### `getResponseHeader(event, name)`

Alias for `getResponseHeaders`.

**Example:**

```ts
export default defineEventHandler((event) => {
const contentType = getResponseHeader(event, "content-type"); // Get the response content-type header
});
```

### `getResponseHeaders(event)`

Get the response headers object.
Expand Down Expand Up @@ -226,33 +187,6 @@ export default defineEventHandler((event) => {

Send a Web besponse object to the client.

### `setHeader(event, name, value)`

Set a response header by name.

**Example:**

```ts
export default defineEventHandler((event) => {
setResponseHeader(event, "content-type", "text/html");
});
```

### `setHeaders(event, headers)`

Set the response headers.

**Example:**

```ts
export default defineEventHandler((event) => {
setResponseHeaders(event, {
"content-type": "text/html",
"cache-control": "no-cache",
});
});
```

### `setResponseHeader(event, name, value)`

Set a response header by name.
Expand Down
2 changes: 1 addition & 1 deletion docs/2.utils/98.advanced.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ Get a cookie value by name.

Parse the request to get HTTP Cookie header string and returning an object of all cookie name-value pairs.

### `setCookie(event, name, value, serializeOptions?)`
### `setCookie(event, name, value, options?)`

Set a cookie value by name.

Expand Down

0 comments on commit 54eaa5b

Please sign in to comment.