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: content/en/docs/hertz/faq/_index.md
+12Lines changed: 12 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -35,6 +35,10 @@ For very vast requests cases, use a combination of streaming and go net.
35
35
36
36
If the framework reports the following error codes, you can check it for possible causes. If there is an error code other than the following, the error code is not caused by the framework and needs to be located by the user to see whether it is set by itself or by some middleware.
37
37
38
+
### 403
39
+
40
+
This status code is returned only when the `fs` feature is enabled and a directory index is accessed without permission. Hertz does not return `403` in other scenarios.
41
+
38
42
### 404
39
43
40
44
1. Access to the wrong port, commonly access to the debug port.
@@ -43,10 +47,18 @@ If the framework reports the following error codes, you can check it for possibl
43
47
1. Check whether all expected routes are registered correctly based on the startup log.
44
48
2. Check that the access method is correct.
45
49
50
+
### 413
51
+
52
+
The request body sent by the client exceeds the maximum size configured by [`WithMaxRequestBodySize`](../reference/config.md) on the server side. The default limit is 4 MB.
53
+
46
54
### 417
47
55
48
56
The server returns `false` after executing the custom `ContinueHandler` (the server actively rejects the subsequent body of the 100 Continue).
49
57
58
+
### 431
59
+
60
+
The request header sent by the client exceeds the maximum size configured by [`WithMaxHeaderBytes`](../reference/config.md) on the server side. The default limit is 1 MB.
61
+
50
62
### 500
51
63
52
64
1. Throwing the panic in middleware or in `handlerFunc`.
Copy file name to clipboardExpand all lines: content/en/docs/hertz/getting-started/_index.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,7 +10,7 @@ description: "Preparation of Hertz development environment, quick start, and bas
10
10
## Set Up Golang Development Environment
11
11
12
12
1. If you haven't set up your Golang environment yet, you can refer to [Golang Install](https://go.dev/doc/install).
13
-
2. We recommend that you use the latest version of Golang, or make sure it's >= v1.16. You can choose to use the earlier versions, but the compatibility and stability are not guaranteed.
13
+
2. We recommend that you use the latest version of Golang, or make sure it's >= v1.19. You can choose to use the earlier versions, but the compatibility and stability are not guaranteed.
14
14
3. Make sure the go mod support is enabled (for Golang versions >= v1.15, it is enabled by default).
15
15
16
16
> Currently, Hertz supports Linux, macOS, and Windows systems.
| GetCompatRequest |`func GetCompatRequest(req *protocol.Request) (*http.Request, error)`| Build and fetch Go standard library `http.Request` from Hertz `protocol.Request`|
64
+
|~~GetCompatRequest~~|`func GetCompatRequest(req *protocol.Request) (*http.Request, error)`|**Deprecated: Please use [`adaptor.HertzHandler`](./http-adaptor.md) instead.** Build and fetch Go standard library `http.Request` from Hertz `protocol.Request`|
65
65
| CopyToHertzRequest |`func CopyToHertzRequest(req *http.Request, hreq *protocol.Request)`| Copy the `URI`, `Host`, `Method`, `Protocol`, `Header` of Go standard library `http.Request` to Hertz `protocol.Request`, The `Body` field will be adapted by sharing `Reader`|
66
66
67
67
## http.ResponseWriter
68
68
69
69
| Function / Struct | Function Signature | Description |
| GetCompatResponseWriter |`func GetCompatResponseWriter(resp *protocol.Response) http.ResponseWriter`| Build and fetch Go standard library `http.ResponseWriter` from Hertz `protocol.Response`|
71
+
|~~GetCompatResponseWriter~~|`func GetCompatResponseWriter(resp *protocol.Response) http.ResponseWriter`|**Deprecated: Please use [`adaptor.HertzHandler`](./http-adaptor.md) instead.** Build and fetch Go standard library `http.ResponseWriter` from Hertz `protocol.Response`|
72
72
| compatResponse | / |`compatResponse` implements the `http.ResponseWriter` interface and has adaptations to `Header`, `Write` and `WriteHeader` functions |
| WithClientReadTimeout | 0s | maximum duration for full response reading (including body). |
63
+
| WithClientReadTimeout | 0s | maximum duration for full response reading (including body). Default 0 means unlimited|
64
64
| WithTLSConfig | nil | tlsConfig to create a tls connection, for specific configuration information, please refer to [tls](/docs/hertz/tutorials/basic-feature/tls/). |
65
-
| WithDialer | network.Dialer | specific dialer. |
65
+
| WithDialer | network.Dialer | specific dialer. The default depends on platform: netpoll on linux/darwin with amd64/arm64 when `HERTZ_NO_NETPOLL=true` is not set; falls back to standard for TLS; standard otherwise.|
66
66
| WithResponseBodyStream | false | determine whether read body in stream or not, default not read in stream. |
67
67
| WithDisableHeaderNamesNormalizing | false | whether disable header names normalizing, default not disabled, for example, cONTENT-lenGTH -> Content-Length. |
68
68
| WithName | "" | set client name which used in User-Agent Header. |
69
69
| WithNoDefaultUserAgentHeader | false | whether default no User-Agent header, default with User-Agent header. |
70
70
| WithDisablePathNormalizing | false | whether disable path normalizing, default specification path, for example, http://localhost:8080/hello/../ hello -> http://localhost:8080/hello.|
71
-
| WithRetryConfig | nil | retry configuration, for specific configuration information, please refer to [retry](/docs/hertz/tutorials/basic-feature/retry/).|
72
-
| WithWriteTimeout | 0s | write timeout. |
71
+
| WithRetryConfig | nil | retry configuration. Not enabled by default; calling it sets `MaxAttemptTimes=1` (no retry). To enable retry, set explicitly. For details see [retry](/docs/hertz/tutorials/basic-feature/retry/). |
0 commit comments