https://github.com/zema1/rawhttp
A mininal go http client for security testing
https://github.com/zema1/rawhttp
Last synced: about 1 year ago
JSON representation
A mininal go http client for security testing
- Host: GitHub
- URL: https://github.com/zema1/rawhttp
- Owner: zema1
- Created: 2022-11-02T02:50:57.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2024-07-28T05:12:36.000Z (almost 2 years ago)
- Last Synced: 2024-07-28T06:24:16.729Z (almost 2 years ago)
- Language: Go
- Size: 22.5 KB
- Stars: 46
- Watchers: 4
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# rawhttp
A minimal http client for testing.
No connection pool, no fixes for RFC.
Modified from [https://github.com/projectdiscovery/rawhttp](https://github.com/projectdiscovery/rawhttp)
```go
package main
import (
"fmt"
"github.com/zema1/rawhttp"
"io/ioutil"
"net/http"
"time"
)
func main() {
options := &rawhttp.Options{
Timeout: 0 * time.Second,
FollowRedirects: false,
MaxRedirects: 0,
AutomaticHostHeader: true,
AutomaticContentLength: false,
ForceReadAllBody: false,
}
client := rawhttp.NewClient(options)
req, _ := http.NewRequest(http.MethodGet, "https://example.com", nil)
resp, err := client.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
data, err := ioutil.ReadAll(resp.Body)
if err != nil {
panic(err)
}
fmt.Println(string(data))
}
```