mirror of
https://github.com/gospider007/requests.git
synced 2025-12-24 13:57:52 +08:00
add http1 with order headers
This commit is contained in:
21
README.md
21
README.md
@@ -75,6 +75,27 @@ func main() {
|
||||
log.Print(resp.StatusCode()) //return status code
|
||||
}
|
||||
```
|
||||
## setting order headers with http1
|
||||
```go
|
||||
package main
|
||||
|
||||
import (
|
||||
"log"
|
||||
|
||||
"github.com/gospider007/requests"
|
||||
)
|
||||
|
||||
func main() {
|
||||
resp, err := requests.Get(nil, "http://httpbin.org/anything", requests.RequestOption{
|
||||
OrderHeaders: []string{"accept-encoding"}},
|
||||
)
|
||||
if err != nil {
|
||||
log.Panic(err)
|
||||
}
|
||||
log.Print(resp.Text())
|
||||
}
|
||||
```
|
||||
|
||||
## send websocket
|
||||
```go
|
||||
package main
|
||||
|
||||
Reference in New Issue
Block a user