java - API请求如何区别是静态文件的请求,还是数据请求
大家讲道理
大家讲道理 2017-04-18 09:52:26
0
2
447

假如我浏览器输入https://segmentfault.com/ask是一个get请求,请求的是一个静态页面。但是我还有一类请求json数据的https://segmentfault.com/a/b/c。后台如何去判断是静态页面的请求,还是json数据请求呢

大家讲道理
大家讲道理

光阴似箭催人老,日月如移越少年。

reply all(2)
洪涛

Judgment based on your route. Use the suffix name to determine the latter

左手右手慢动作

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

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template