MCPcopy Create free account
hub / github.com/devfeel/dotweb / WriteJsonp

Method WriteJsonp

context.go:645–651  ·  view source on GitHub ↗

WriteJsonp write jsonp string to response

(callback string, i interface{})

Source from the content-addressed store, hash-verified

643
644// WriteJsonp write jsonp string to response
645func (ctx *HttpContext) WriteJsonp(callback string, i interface{}) error {
646 b, err := json.Marshal(i)
647 if err != nil {
648 return err
649 }
650 return ctx.WriteJsonpBlob(callback, b)
651}
652
653// WriteJsonpBlob write jsonp string as []byte to response
654func (ctx *HttpContext) WriteJsonpBlob(callback string, b []byte) error {

Callers

nothing calls this directly

Calls 1

WriteJsonpBlobMethod · 0.95

Tested by

no test coverage detected