背景
一个遗留前端需要调用接口 要求是jsonp格式的返回 怎么对现有的接口返回进行封装呢? 使其变成jsonp的格式
$arg_callback(...)
如 正常的请求
➜ ~ curl http://localhost/foo
{"hello":"world"}%
jsonp请求
➜ ~ curl http://localhost/foo/jsonp\?callback\=foo
foo({"hello":"world"})
一个遗留前端需要调用接口 要求是jsonp格式的返回 怎么对现有的接口返回进行封装呢? 使其变成jsonp的格式
$arg_callback(...)
如 正常的请求
➜ ~ curl http://localhost/foo
{"hello":"world"}%
jsonp请求
➜ ~ curl http://localhost/foo/jsonp\?callback\=foo
foo({"hello":"world"})
2 回答2.4k 阅读✓ 已解决
1 回答1.8k 阅读✓ 已解决
1 回答1.2k 阅读✓ 已解决
3 回答1k 阅读
1 回答726 阅读
560 阅读
1 回答197 阅读✓ 已解决
http_sub_module
?ngx_http_substitutions_filter
?