net/test_client/main.go

28 lines
439 B
Go
Raw Normal View History

2024-02-03 16:26:09 +00:00
package main
import (
"fmt"
"git.3crabs.ru/VLADIMIR/net/http"
)
func main() {
r, err := http.Do(
"GET",
"https://3crabs.ru:443",
[]*http.Header{
{Name: "Host", Value: "3crabs.ru"},
{Name: "User-Agent", Value: "3crabs/0.0.1"},
{Name: "Accept", Value: "*/*"},
},
)
2024-02-03 16:26:09 +00:00
if err != nil {
panic(err)
}
fmt.Println(r.StatusCode)
for _, header := range r.Headers {
fmt.Println(header)
}
fmt.Println(string(r.Body))
2024-02-03 16:26:09 +00:00
}