1
This commit is contained in:
parent
933ed5c972
commit
f9776ebd7c
@ -3,6 +3,7 @@ package q5
|
|||||||
import (
|
import (
|
||||||
"os"
|
"os"
|
||||||
"net"
|
"net"
|
||||||
|
"fmt"
|
||||||
"net/http"
|
"net/http"
|
||||||
"time"
|
"time"
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
@ -45,6 +46,14 @@ func Request(r *http.Request, name string) *XValue {
|
|||||||
return NewXString("")
|
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 {
|
func GetPostBody(r *http.Request) *XValue {
|
||||||
body, err := ioutil.ReadAll(r.Body)
|
body, err := ioutil.ReadAll(r.Body)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user