Advertisement
Guest User

Untitled

a guest
Feb 24th, 2018
508
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Go 0.33 KB | None | 0 0
  1. type posted struct {
  2.     email    string `json:"email"`
  3.     password string `json:"password"`
  4. }
  5.  
  6. func Login(w http.ResponseWriter, r *http.Request) {
  7.  
  8.     var data posted
  9.  
  10.     decoder := json.NewDecoder(r.Body)
  11.     decoder.Decode(&data)
  12.  
  13.     body,err := ioutil.ReadAll(r.Body)
  14.  
  15.     err = json.Unmarshal(body, &data); if err != nil { panic(err) }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement