Skip to content

Commit

Permalink
python调用库增加有序请求头
Browse files Browse the repository at this point in the history
  • Loading branch information
wangluozhe committed May 21, 2023
1 parent 28dc19a commit 91170aa
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 3 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# requests
[![Gitee link address](https://img.shields.io/badge/gitee-reference-red?logo=gitee&logoColor=red&labelColor=white)](https://gitee.com/leegene/requests)[![Github link address](https://img.shields.io/badge/github-reference-blue?logo=github&logoColor=black&labelColor=white&color=black)](https://github.com/wangluozhe/requests)[![Go Version](https://img.shields.io/badge/Go%20Version-1.20-blue?logo=go&logoColor=white&labelColor=gray)]()[![Release Version](https://img.shields.io/badge/release-v1.1.12-blue)]()[![go documentation](https://img.shields.io/badge/go-documentation-blue)](https://pkg.go.dev/github.com/wangluozhe/requests)[![license GPL-3.0](https://img.shields.io/badge/license-GPL3.0-orange)](https://github.com/wangluozhe/requests/blob/main/LICENSE)
[![Gitee link address](https://img.shields.io/badge/gitee-reference-red?logo=gitee&logoColor=red&labelColor=white)](https://gitee.com/leegene/requests)[![Github link address](https://img.shields.io/badge/github-reference-blue?logo=github&logoColor=black&labelColor=white&color=black)](https://github.com/wangluozhe/requests)[![Go Version](https://img.shields.io/badge/Go%20Version-1.20-blue?logo=go&logoColor=white&labelColor=gray)]()[![Release Version](https://img.shields.io/badge/release-v1.1.13-blue)]()[![go documentation](https://img.shields.io/badge/go-documentation-blue)](https://pkg.go.dev/github.com/wangluozhe/requests)[![license GPL-3.0](https://img.shields.io/badge/license-GPL3.0-orange)](https://github.com/wangluozhe/requests/blob/main/LICENSE)

requests支持以下新特性:

Expand All @@ -24,7 +24,7 @@ go get github.com/wangluozhe/requests
## 下载指定版

```bash
go get github.com/wangluozhe/[email protected].12
go get github.com/wangluozhe/[email protected].13
```


Expand Down
1 change: 1 addition & 0 deletions libs/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ type RequestParams struct {
Url string `json:"Url"`
Params map[string]string `json:"Params"`
Headers map[string]string `json:"Headers"`
HeadersOrder []string `json:"HeadersOrder"`
Cookies map[string]string `json:"Cookies"`
Data map[string]string `json:"Data"`
Json map[string]interface{} `json:"Json"`
Expand Down
3 changes: 3 additions & 0 deletions libs_dist/export.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@ func request(requestParamsChar *C.char) *C.char {
headers.Set(key, value)
}
req.Headers = headers
if requestParams.HeadersOrder != nil {
(*req.Headers)[http.HeaderOrderKey] = requestParams.HeadersOrder
}
}

if requestParams.Cookies != nil {
Expand Down
2 changes: 1 addition & 1 deletion version.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ package requests

const (
NAME = "golang-requests" // 名称
VERSION = "1.1.12" // 当前版本
VERSION = "1.1.13" // 当前版本
USER_AGENT = NAME + VERSION // UA
)

0 comments on commit 91170aa

Please sign in to comment.