ing
This commit is contained in:
parent
46cfc967a9
commit
71b3163827
|
@ -7,14 +7,14 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
func SendRESTResponse(ctx *fasthttp.RequestCtx, response interface{}) {
|
func SendRESTResponse(ctx *fasthttp.RequestCtx, response interface{}) {
|
||||||
ctx.SetContentType("application/javascript")
|
ctx.SetContentType("application/json")
|
||||||
|
|
||||||
jRes, _ := json.Marshal(response)
|
jRes, _ := json.Marshal(response)
|
||||||
ctx.SetBody(jRes)
|
ctx.SetBody(jRes)
|
||||||
}
|
}
|
||||||
|
|
||||||
func SendRESTError(ctx *fasthttp.RequestCtx, statusCode int, err error) {
|
func SendRESTError(ctx *fasthttp.RequestCtx, statusCode int, err error) {
|
||||||
ctx.SetContentType("application/javascript")
|
ctx.SetContentType("application/json")
|
||||||
ctx.SetStatusCode(statusCode)
|
ctx.SetStatusCode(statusCode)
|
||||||
|
|
||||||
jRes, _ := json.Marshal(err)
|
jRes, _ := json.Marshal(err)
|
Loading…
Reference in New Issue
Block a user