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
This happens when constructing the native `Request` object.
234
254
235
-
-**Query**: `ctx.query` is merged into the final URL's search params.
236
-
- Priority: `ctx.query` > URL search params (from step 1 or modified by hooks).
255
+
-**Query**: `ctx.request.query` is merged into the final URL's search params.
256
+
- Priority: `ctx.request.query` > URL search params (from step 1 or modified by hooks).
237
257
-**Headers**: Final headers are built.
238
258
239
259
### Merge Rules
@@ -244,9 +264,9 @@ This happens when constructing the native `Request` object.
244
264
245
265
### Note on Hooks
246
266
247
-
- Modifications to `ctx.url` in hooks (e.g. `beforeRequest`) will **NOT** be parsed into `ctx.query`. They are treated as separate entities until the final merge.
248
-
- If you replace `ctx.url` in a hook, you lose the original URL search params unless you manually preserve them.
249
-
- To modify query parameters reliably in hooks, prefer operating on `ctx.query`.
267
+
- Modifications to `ctx.request.url` in hooks (e.g. `beforeRequest`) will **NOT** be parsed into `ctx.request.query`. They are treated as separate entities until the final merge.
268
+
- If you replace `ctx.request.url` in a hook, you lose the original URL search params unless you manually preserve them.
269
+
- To modify query parameters reliably in hooks, prefer operating on `ctx.request.query`.
250
270
251
271
## Hooks
252
272
@@ -257,13 +277,23 @@ Return `false` to abort request immediately.
@@ -304,11 +335,11 @@ JSON body has been transformed to JSON string. `Content-Type` header has been se
304
335
305
336
### beforeActualFetch
306
337
307
-
-`ctx.rawRequest`: `{Request}` now available.
338
+
-`ctx.request.rawRequest`: `{Request}` now available.
308
339
309
340
The Request instance has been generated.
310
341
311
-
At this time, you cannot modify the `ctx.url`, `ctx.query`, `ctx.headers` or `ctx.body` (etc.) anymore. Unless you pass a brand new `Request` to replace `ctx.rawRequest`.
342
+
At this time, you cannot modify `ctx.request.url`, `ctx.request.query`, `ctx.request.headers` or `ctx.request.body` (etc.) anymore, unless you pass a brand new `Request` to replace `ctx.request.rawRequest`.
0 commit comments