dtjo87679 2018-09-27 15:39
浏览 46

PHP Rest API端点

i am making an Rest API and this is my first one. I am a little bit confused with the endpoints. [1]http://localhost/01_Diplo/API/API/API/api/participants/ thats what a http request looks right now. This will return a list of all participants from a table. [2]http://localhost/01_Diplo/API/API/API/api/participants?kz=14escs37 this would get me one specific participant with the "kz" = 14escs37. participants is just a folder with a index.php inside and i simple check for get request and get value.

Is this how it should look like because some others would make it like this: [3]http://localhost/01_Diplo/API/API/API/api/participants/14escs37 to get on specific user.

I wonder how i can implement this because when i enter this[3] in my url it expects 14escs37 to be a folder but i want it as an endpoint.

How can i program this into my index.php?

Thanks in advance Simon

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥20 有关区间dp的问题求解
    • ¥15 多电路系统共用电源的串扰问题
    • ¥15 slam rangenet++配置
    • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
    • ¥15 对于相关问题的求解与代码
    • ¥15 ubuntu子系统密码忘记
    • ¥15 信号傅里叶变换在matlab上遇到的小问题请求帮助
    • ¥15 保护模式-系统加载-段寄存器
    • ¥15 电脑桌面设定一个区域禁止鼠标操作
    • ¥15 求NPF226060磁芯的详细资料