Beispiel #1
0
func hsBuilder(method, url_ string, v url.Values, uid int64, uname string) *routing.HTTPSession {
	var hs *routing.HTTPSession = &routing.HTTPSession{}

	hs.S = Session{uid}
	hs.W = writer{new([]byte)}
	req, _ := http.NewRequest(method, url_, strings.NewReader(v.Encode()))
	if method == "POST" {
		req.Header.Set("Content-Type", "application/x-www-form-urlencoded; param=value")
	}
	hs.R = req
	hs.Kvs = map[string]interface{}{
		"USR": &usr.Usr{
			Tid: uid,
			Usr: uname,
		},
	}
	return hs
}