https://github.com/gospider007/requests
🚀A next-generation HTTP client for Golang, Support for http1, http2, http3, websocket, sse, utls, uquic
https://github.com/gospider007/requests
chain-proxy go golang http http-client http2 http3 https ja3 ja4 quic sse udp-proxy websocket
Last synced: about 1 month ago
JSON representation
🚀A next-generation HTTP client for Golang, Support for http1, http2, http3, websocket, sse, utls, uquic
- Host: GitHub
- URL: https://github.com/gospider007/requests
- Owner: gospider007
- License: other
- Created: 2023-10-15T05:43:29.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2025-03-27T09:41:41.000Z (about 1 month ago)
- Last Synced: 2025-03-28T11:06:38.464Z (about 1 month ago)
- Topics: chain-proxy, go, golang, http, http-client, http2, http3, https, ja3, ja4, quic, sse, udp-proxy, websocket
- Language: Go
- Homepage:
- Size: 670 KB
- Stars: 183
- Watchers: 6
- Forks: 30
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Requests - A next-generation HTTP client for Golang.
---
A request library designed specifically for web crawlers
Requests is a fully featured HTTP client library for Golang. Network requests can be completed with just a few lines of code. Unified support for http1, http2, http3, websocket, sse, utls, uquic
## Innovative Features
| **gospider007/requests** | **Other Request Libraries** |
|---------------------------|----------------------------|
| Unlimited chained proxy | Not supported |
| HTTP/3 fingerprint spoofing protection | Not supported |
| Arbitrary closure of underlying connections | Not supported |
| Genuine request-level proxy settings | Not supported |
| Unique transport layer management mechanism, fully unifying HTTP/1, HTTP/2, HTTP/3, WebSocket, SSE, UTLS, QUIC protocol handling | Not supported |## Features
* [Simple for settings and Request](https://github.com/gospider007/requests#quickly-send-requests)
* [Request](https://github.com/gospider007/requests/tree/master/test/request) Support Automatic type conversion, Support orderly map
* [Json Request](https://github.com/gospider007/requests/blob/master/test/request/json_test.go) with `application/json`
* [Data Request](https://github.com/gospider007/requests/blob/master/test/request/data_test.go) with `application/x-www-form-urlencoded`
* [Form Request](https://github.com/gospider007/requests/blob/master/test/request/form_test.go) with `multipart/form-data`
* [Upload File Request](https://github.com/gospider007/requests/blob/master/test/request/file_test.go) with `multipart/form-data`
* [Flow Request](https://github.com/gospider007/requests/blob/master/test/request/stream_test.go)
* [Request URL Path Params](https://github.com/gospider007/requests/blob/master/test/request/params_test.go)
* [Local network card](https://github.com/gospider007/requests/blob/master/test/request/localAddr_test.go)
* [Response](https://github.com/gospider007/requests/tree/master/test/response)
* [Return whether to reuse connections](https://github.com/gospider007/requests/blob/master/test/response/isNewConn_test.go)
* [Return Raw Connection](https://github.com/gospider007/requests/blob/master/test/response/rawConn_test.go)
* [Return Proxy](https://github.com/gospider007/requests/blob/master/test/response/useProxy_test.go)
* [Middleware](https://github.com/gospider007/requests/tree/master/test/middleware)
* [Option Callback Method](https://github.com/gospider007/requests/blob/master/test/middleware/optionltCallBack_test.go)
* [Result Callback Method](https://github.com/gospider007/requests/blob/master/test/middleware/resultCallBack_test.go)
* [Redirect Callback Method](https://github.com/gospider007/requests/blob/master/test/middleware/redirectCallBack_test.go)
* [Error Callback Method](https://github.com/gospider007/requests/blob/master/test/middleware/errCallBack_test.go)
* [Request Callback Method](https://github.com/gospider007/requests/blob/master/test/middleware/requestCallback_test.go)
* [Retry](https://github.com/gospider007/requests/blob/master/test/middleware/try_test.go)
* [Protocol](https://github.com/gospider007/requests/tree/master/test/protocol)
* [HTTP1](https://github.com/gospider007/requests/blob/master/test/protocol/http1_test.go)
* [HTTP2](https://github.com/gospider007/requests/blob/master/test/protocol/http2_test.go)
* [HTTP3](https://github.com/gospider007/requests/blob/master/test/protocol/http3_test.go)
* [WebSocket](https://github.com/gospider007/requests/blob/master/test/protocol/websocket_test.go)
* [SSE](https://github.com/gospider007/requests/blob/master/test/protocol/sse_test.go)
* [Fingerprint](https://github.com/gospider007/requests/tree/master/test/fingerprint)
* [Ja3 Fingerprint](https://github.com/gospider007/requests/blob/master/test/fingerprint/ja3_test.go)
* [Http2 Fingerprint](https://github.com/gospider007/requests/blob/master/test/fingerprint/http2_test.go)
* [Quic Fingerprint](https://github.com/gospider007/requests/blob/master/test/fingerprint/quic_test.go)
* [Ja4 Fingerprint](https://github.com/gospider007/requests/blob/master/test/fingerprint/ja4_test.go)
* [Session](https://github.com/gospider007/requests/blob/master/test/session_test.go)
* [IPv4, IPv6 Address Control Parsing](https://github.com/gospider007/requests/blob/master/test/addType_test.go)
* [DNS Settings](https://github.com/gospider007/requests/blob/master/test/dns_test.go)
* [Proxy](https://github.com/gospider007/requests/blob/master/test/proxy/proxy_test.go)
* [Chain Proxy](https://github.com/gospider007/requests/blob/master/test/proxy/chain_proxy_test.go)
* [Logger](https://github.com/gospider007/requests/blob/master/test/logger/logger_test.go)
* [Well tested client library](https://github.com/gospider007/requests/tree/master/test)## Supported Go Versions
Recommended to use `go1.23.0` and above.
Initially Requests started supporting `go modules`## Installation
```bash
go get github.com/gospider007/requests
```
## Usage
```go
import "github.com/gospider007/requests"
```
### Quickly Send Requests
```go
package mainimport (
"log"
"time"
"github.com/gospider007/requests"
)func main() {
resp, err := requests.Get(nil, "http://httpbin.org/anything")
if err != nil {
log.Panic(err)
}
log.Print(resp.Text()) // Get content and parse as string
log.Print(resp.Content()) // Get content as bytes
log.Print(resp.Json()) // Get content and parse as gjson JSON
log.Print(resp.Html()) // Get content and parse as goquery DOM
log.Print(resp.Cookies()) // Get cookies
}
```# Contributing
If you have a bug report or feature request, you can [open an issue](../../issues/new)
# Contact
If you have questions, feel free to reach out to us in the following ways:
* QQ Group (Chinese): 939111384 -![]()
* WeChat (Chinese): gospider007## Sponsors
If you like and it really helps you, feel free to reward me with a cup of coffee, and don't forget to mention your github id.
![]()
![]()
Alipay
## License
This project is licensed under the Mozilla Public License 2.0 (MPL-2.0) with additional author attribution requirements.
See the [LICENSE](./LICENSE) file for details.