假如我浏览器输入https://segmentfault.com/ask是一个get请求,请求的是一个静态页面。但是我还有一类请求json数据的https://segmentfault.com/a/b/c。后台如何去判断是静态页面的请求,还是json数据请求呢
PHP中文网2017-04-18 09:54:26
Judgment based on your route. Use the suffix name to determine the latter
ringa_lee2017-04-18 09:54:26
If identification and processing are required, then the background is a request entrance, and then identification and processing are performed based on the different request parameters.
But according to what you said, it already corresponds to different request paths. You can identify them based on the request paths