Go实战--golang中使用echo框架中JSONP(labstack/echo)

àì夳堔傛蜴生んèń 2022-06-05 10:19 434阅读 0赞

生命不止,继续 go go go !!!

继续,echo web框架,今天就聊一聊JSONP。

JSONP

1、什么是JSONP?

JSONP (JSON with padding) is used to request data from a server residing in a different domain than the client. It was proposed by Bob Ippolito in 2005.

JSONP enables sharing of data bypassing same-origin policy. The policy disallows running JavaScript to read media DOM elements or XHR data fetched from outside the page’s origin. The aggregation of the site’s scheme, port number and host name identifies as its origin. Due to inherent insecurities, JSONP is being replaced by CORS.

关于golang中cors可以参考:Go实战–golang中使用echo框架中的cors(labstack/echo、rs/cors)

要了解JSONP,不得不提一下JSON,那么什么是JSON ?

JSON is a subset of the object literal not

发表评论

表情:
评论列表 (有 0 条评论,434人围观)

还没有评论,来说两句吧...

相关阅读