Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ghttp: Can support setting default values ​​for header? #4078

Open
nilsir opened this issue Dec 25, 2024 · 0 comments
Open

ghttp: Can support setting default values ​​for header? #4078

nilsir opened this issue Dec 25, 2024 · 0 comments
Labels

Comments

@nilsir
Copy link

nilsir commented Dec 25, 2024

Is your feature request related to a problem?

Option Yes

Describe the solution you'd like

I want to set a default value when the header information is empty

Describe alternatives you've considered

# now is 
language := r.GetHeader("lang")
if language == "" {
    language = "zh-CN"
}

# replace is
r.GetHeader("lang", "zh-CN") 

Additional

No response

@nilsir nilsir added the feature label Dec 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant