mirror of
https://github.com/gospider007/requests.git
synced 2025-12-24 13:57:52 +08:00
optimize code
This commit is contained in:
12
headers.go
12
headers.go
@@ -12,18 +12,6 @@ const (
|
||||
AcceptLanguage = "zh-CN,zh;q=0.9,en;q=0.8,en-GB;q=0.7,en-US;q=0.6"
|
||||
)
|
||||
|
||||
// get default headers
|
||||
func defaultHeaders() http.Header {
|
||||
return http.Header{
|
||||
"User-Agent": []string{UserAgent},
|
||||
"Accept": []string{"text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7"},
|
||||
"Accept-Encoding": []string{"gzip, deflate, br"},
|
||||
"Accept-Language": []string{AcceptLanguage},
|
||||
"Sec-Ch-Ua": []string{SecChUa},
|
||||
"Sec-Ch-Ua-Mobile": []string{"?0"},
|
||||
"Sec-Ch-Ua-Platform": []string{`"Windows"`},
|
||||
}
|
||||
}
|
||||
func (obj *RequestOption) initHeaders() (http.Header, error) {
|
||||
if obj.Headers == nil {
|
||||
return nil, nil
|
||||
|
||||
Reference in New Issue
Block a user