0
在搜索查询中包含相关资源的最佳做法是什么?REST API过滤和相关资源最佳实践
我的资源有:
/projects
/participants
/questions
/questionAnswers
查询会是这样的:让谁是所有参与者:
- between the age of 20 and 40 and,
- male and,
- selected answer X of question y
它会是这样的
/参与者搜索=性别? :男性,年龄> = 20,年龄< = 40,提问:x,回答:y
这种查询有更好的还是标准的方法吗?
就个人而言,我宁愿使用应用程序/ x-WWW-形式urlencoded并将其作为POST发送。这是个人观点,我可能是错的。也许这将帮助https://stackoverflow.com/questions/4024271/rest-api-best-practices-where-to-put-parameters –
也许[GraphQL](https://github.com/facebook/graphql)会对你的情况更可行吗? – Kim