Slide 12
Slide 12 text
©2018 Wantedly, Inc.
8):H31$ ʮͨͩͨͩ࡞Δͷ͕໘ʯ
data, err := ioutil.ReadAll(req.Body)
if err != nil {
http.Error(w, err.Error(), http.InternalStatusInternalServerError)
return
}
book := &Book{}
err = json.Unmarshal(data, book)
if err != nil {
http.Error(w, err.Error(), http.InternalStatusInternalServerError)
return
}
// ここから本当にやりたい処理
net/http Λͦͷ··ͬͨ߹