1
This commit is contained in:
parent
933ed5c972
commit
f9776ebd7c
@ -3,6 +3,7 @@ package q5
|
||||
import (
|
||||
"os"
|
||||
"net"
|
||||
"fmt"
|
||||
"net/http"
|
||||
"time"
|
||||
"io/ioutil"
|
||||
@ -45,6 +46,14 @@ func Request(r *http.Request, name string) *XValue {
|
||||
return NewXString("")
|
||||
}
|
||||
|
||||
func ResponseOk(w http.ResponseWriter) {
|
||||
w.Write([]byte(`{"errcode":0, "errmsg":""}`))
|
||||
}
|
||||
|
||||
func ResponseInt32Ok(w http.ResponseWriter, key string, val int32) {
|
||||
w.Write([]byte(fmt.Sprintf(`{"errcode":0, "errmsg":"", "%s":%d}`, key, val)))
|
||||
}
|
||||
|
||||
func GetPostBody(r *http.Request) *XValue {
|
||||
body, err := ioutil.ReadAll(r.Body)
|
||||
if err != nil {
|
||||
|
Loading…
x
Reference in New Issue
Block a user