Skip to content

Commit

Permalink
add 0201
Browse files Browse the repository at this point in the history
  • Loading branch information
ryuichi1208 committed Feb 14, 2024
1 parent 6e7b812 commit cecc480
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 0 deletions.
3 changes: 3 additions & 0 deletions tmp/go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module mm

go 1.21.5
31 changes: 31 additions & 0 deletions tmp/main.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
package main

import (
"fmt"
"io/ioutil"
"net/http"
)

func main() {
client := &http.Client{}
req, err := http.NewRequest("GET", "http://example.com", nil)
if err != nil {
fmt.Println(err)
return
}

resp, err := client.Do(req)
if err != nil {
fmt.Println(err)
return
}
defer resp.Body.Close()

body, err := ioutil.ReadAll(resp.Body)
if err != nil {
fmt.Println(err)
return
}

fmt.Println(string(body))
}

0 comments on commit cecc480

Please sign in to comment.