Skip to content

Commit 078a6e2

Browse files
committed
Applies APIRequest to Speed docs
1 parent 4b6c594 commit 078a6e2

File tree

2 files changed

+17
-22
lines changed

2 files changed

+17
-22
lines changed

src/content/docs/speed/optimization/content/speed-brain.mdx

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ sidebar:
88
description: Learn how Speed Brain enhances web performance by prefetching likely next pages, improving metrics like LCP and TTFB.
99
---
1010

11-
import { FeatureTable, TabItem, Tabs } from "~/components";
11+
import { FeatureTable, TabItem, Tabs, APIRequest } from "~/components";
1212

1313
Speed Brain is a tool for improving web page performance by prefetching the most likely next navigation.
1414

@@ -87,15 +87,13 @@ To enable or disable **Speed Brain** in the dashboard:
8787

8888
Use the following `PATCH` request to enable Speed Brain:
8989

90-
```bash
91-
curl --request PATCH \
92-
"https://api.cloudflare.com/client/v4/zones/{zone_id}/settings/speed_brain" \
93-
--header "Authorization: Bearer <API_TOKEN>" \
94-
--header "Content-Type: application/json" \
95-
--data '{
96-
"value":"on"
97-
}'
98-
```
90+
<APIRequest
91+
path="/zones/{zone_id}/settings/speed_brain"
92+
method="PATCH"
93+
json={{
94+
value: "on"
95+
}}
96+
/>
9997

10098
To disable Speed Brain, set `value:` to `"off"`.
10199

src/content/docs/speed/optimization/protocol/http2-to-origin.mdx

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ title: HTTP/2 to Origin
44

55
---
66

7-
import { FeatureTable, Details, Render } from "~/components"
7+
import { FeatureTable, Details, Render, APIRequest } from "~/components"
88

99
A protocol is a set of rules governing the exchange or transmission of data between devices. One of the most important protocols that run on the human-computer interaction layer, where applications can access the network services, is HTTP (Hypertext Transfer Protocol).
1010

@@ -45,17 +45,14 @@ Connection multiplexing is enabled by default on Free, Pro and Business zones an
4545

4646
<Details header="API">
4747

48-
```bash
49-
curl --request PATCH \
50-
https://api.cloudflare.com/client/v4/zones/<ZONE_ID>/settings/origin_h2_max_streams \
51-
--header 'Content-Type: application/json' \
52-
--header "X-Auth-Email: <CLOUDFLARE_EMAIL>" \
53-
--header "X-Auth-Key: <CLOUDFLARE_API_KEY>" \
54-
--data '{
55-
"value": <int>
56-
}'
57-
```
58-
48+
<APIRequest
49+
path="/zones/{zone_id}/settings/origin_h2_max_streams"
50+
method="PATCH"
51+
json={{
52+
value: 100
53+
}}
54+
/>
55+
5956
Refer to the [API documentation](/api/python/resources/zones/subresources/settings/methods/edit/) for more information.
6057

6158
</Details>

0 commit comments

Comments
 (0)