Open xzavierluol opened 5 years ago
According to his example, it should return x({"foo":"bar"}), but I used the following command and got a 404 not found.
[GIN] 2024/02/03 - 23:57:59 | 404 | 730ns | 127.0.0.1 | GET "/JSONP?callback=x"
Just change it to JSONP, and then request like this: GET /JSONP?callback=x HTTP/1.1
the code in https://gin-gonic.com/zh-cn/docs/examples/jsonp/ r.GET("/JSONP?callback=x", func(c *gin.Context) { data := map[string]interface{}{ "foo": "bar", }
}) need to be: r.GET("/JSONP", func(c *gin.Context) { data := map[string]interface{}{ "foo": "bar", }
})