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
Copy file name to clipboardExpand all lines: docs/src/content/docs/openapi-fetch/api.md
+3-3
Original file line number
Diff line number
Diff line change
@@ -21,7 +21,7 @@ createClient<paths>(options);
21
21
22
22
## Fetch options
23
23
24
-
The following options apply to all request methods (`.get()`, `.post()`, etc.)
24
+
The following options apply to all request methods (`.GET()`, `.POST()`, etc.)
25
25
26
26
```ts
27
27
client.get("/my-url", options);
@@ -43,7 +43,7 @@ client.get("/my-url", options);
43
43
This library uses <ahref="https://developer.mozilla.org/en-US/docs/Web/API/URLSearchParams"target="_blank"rel="noopener noreferrer">URLSearchParams</a> to <ahref="https://swagger.io/docs/specification/serialization/"target="_blank"rel="noopener noreferrer">serialize query parameters</a>. For complex query param types (e.g. arrays) you’ll need to provide your own `querySerializer()` method that transforms query params into a URL-safe string:
The pathname of `get()`, `put()`, `post()`, etc. **must match your schema literally.** Note in the example, the URL is `/blogposts/{post_id}`. This library will replace all `path` params for you (so they can be typechecked)
113
+
The pathname of `GET()`, `PUT()`, `POST()`, etc. **must match your schema literally.** Note in the example, the URL is `/blogposts/{post_id}`. This library will replace all `path` params for you (so they can be typechecked)
114
114
115
115
> ✨ **Tip**
116
116
>
@@ -121,9 +121,9 @@ The pathname of `get()`, `put()`, `post()`, etc. **must match your schema litera
121
121
122
122
### Request
123
123
124
-
The `get()` request shown needed the `params` object that groups <ahref="https://spec.openapis.org/oas/latest.html#parameter-object"target="_blank"rel="noopener noreferrer">parameters by type</a> (`path` or `query`). If a required param is missing, or the wrong type, a type error will be thrown.
124
+
The `GET()` request shown needed the `params` object that groups <ahref="https://spec.openapis.org/oas/latest.html#parameter-object"target="_blank"rel="noopener noreferrer">parameters by type</a> (`path` or `query`). If a required param is missing, or the wrong type, a type error will be thrown.
125
125
126
-
The `post()` request required a `body` object that provided all necessary <ahref="https://spec.openapis.org/oas/latest.html#request-body-object"target="_blank"rel="noopener noreferrer">requestBody</a> data.
126
+
The `POST()` request required a `body` object that provided all necessary <ahref="https://spec.openapis.org/oas/latest.html#request-body-object"target="_blank"rel="noopener noreferrer">requestBody</a> data.
0 commit comments