28 lines
439 B
Go
28 lines
439 B
Go
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: "*/*"},
|
|
},
|
|
)
|
|
if err != nil {
|
|
panic(err)
|
|
}
|
|
fmt.Println(r.StatusCode)
|
|
for _, header := range r.Headers {
|
|
fmt.Println(header)
|
|
}
|
|
fmt.Println(string(r.Body))
|
|
}
|