2015-11-18

(Go) 웹서비스에 POST 요청으로 값 넘겨서 처리하기



import (
    "net/http"
    "net/url"
)
 
func reqPost() {
    postUrl := "http://example.com/test"
    values := make(url.Values)
    values.Set("name", "HongGilDong")
    values.Set("age", 31)
    req, _ := http.PostForm(postUrl, values)
    defer req.Body.Close()
}


댓글 없음:

댓글 쓰기