2024-02-03 16:26:09 +00:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
|
|
|
"fmt"
|
|
|
|
|
|
|
|
"git.3crabs.ru/VLADIMIR/net/http"
|
|
|
|
)
|
|
|
|
|
|
|
|
func main() {
|
2024-02-04 08:17:32 +00:00
|
|
|
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)
|
|
|
|
}
|
2024-02-04 08:17:32 +00:00
|
|
|
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
|
|
|
}
|