Documentation
¶
Overview ¶
Package httputil provides HTTP utilities for safe request/response handling.
Index ¶
Constants ¶
View Source
const ( // MaxErrorBodySize is the maximum size for error response bodies (64KB). MaxErrorBodySize int64 = 64 * 1024 // MaxJSONBodySize is the maximum size for JSON response bodies (1MB). MaxJSONBodySize int64 = 1024 * 1024 // MaxFileBodySize is the maximum size for file downloads (100MB). MaxFileBodySize int64 = 100 * 1024 * 1024 )
Default limits for response body reads.
Variables ¶
This section is empty.
Functions ¶
func LimitReader ¶
LimitReader wraps io.LimitReader for consistency.
func ReadErrorBody ¶
ReadErrorBody reads an error response body with a safe limit. Useful for reading error messages from failed HTTP responses.
func ReadJSONBody ¶
ReadJSONBody reads a JSON response body with a safe limit.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.