search

Home  >  Q&A  >  body text

java - API请求如何区别是静态文件的请求,还是数据请求

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

大家讲道理大家讲道理2898 days ago451

reply all(2)I'll reply

  • PHP中文网

    PHP中文网2017-04-18 09:54:26

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

    reply
    0
  • ringa_lee

    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

    reply
    0
  • Cancelreply