Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 | 29 |
30 | 31 |
Tags
- write
- tcp
- bitcoin
- range
- mutex
- Sync
- FOR
- package
- File
- 리뷰
- Linux
- install
- API
- Close
- Python
- c++
- json
- 책
- Callback
- C
- channel
- window
- http
- windows
- 영화
- JavaScript
- Golang
- go언어
- go
- GO 언어
Archives
- Today
- Total
목록ReadAll (1)
Code Habit
Golang ) http 서버 - Get/Post 요청 처리하기
앞에서 포스팅한 "net/http" 패키지로 http 서버 구현 후 Get/Post 요청을 구분하여 처리하는 예제이다. 예제 - 서버 // main.go package main import ( "fmt" "io/ioutil" "net/http" ) func handler(rw http.ResponseWriter, req *http.Request) { fmt.Println("Method : ", req.Method) fmt.Println("URL : ", req.URL) fmt.Println("Header : ", req.Header) b, _ := ioutil.ReadAll(req.Body) defer req.Body.Close() fmt.Println("Body : ", string(b)) switch..
카테고리 없음
2020. 6. 24. 07:19