I need to know how to generate API's dynamically, let's we assume that we have their definitions in an XML file, like the below:
<?xml version="1.0" encoding="UTF-8" ?>
<APIS>
<API>
<APIName>getCategories</APIName>
<APIinputs>
<categoryName>Politics</categoryName>
<categoryID>1150</categoryID>
</APIinputs>
</API>
<API>
<APIName>getEmployees</APIName>
<APIinputs>
<DepartmentName>HR</DepartmentName>
<DepartmentID>1150</DepartmentID>
</APIinputs>
</API>
</APIS>
Now what needs to be done, is to to read the above and generate from it the listed API's. So then we would have the APIs generated and they can be called from their URLs like this www.example.com/api/v1/controller/getCategories/{categoryName}/{categoryID}
Can you please provide me some insight of this.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.