如何查询与该字段具有相同字段的一些API请求?

时间:2018-09-10 20:19:25

标签: javascript api cypress

API请求示例:https://www.sbsb.com/api/v250/animals/123456789/humans/987654321 / transplant?$ skip = 0&$ top = 666&$ orderby = animalAssociatedHumans / sortDate

是否有api / / animals / / humans / * / transplant之类的东西?...... / sortDate可以捕获所有具有'api','animals'的相似API请求,“人类”,“移植”字样?

我在cy.route('Get或Post',(URL请求:我需要的东西),'fixture:file')中使用它

1 个答案:

答案 0 :(得分:1)

要捕获所有这些单词,请在它们之间提供所提供的数字,并允许transplant之后的任意数量的内容使用,

cy.route("GET", "/api/*/animals/*/humans/*/transplant/**").as("getStuff")