用户(XML)
XML 用户:基于 4 个固定用户(ID 101-104)的 CRUD,接受并返回 application/xml。
你的账号已解锁这些端点。在每个端点的页面上用 Try it 发送请求。
- GET
https://api.testingapis.com/api/xml/UserXML/{id}Get a user by ID as XMLGet a user by ID as XML. - GET
https://api.testingapis.com/api/xml/UserXML/allList all users as XMLList all users as XML. - POST
https://api.testingapis.com/api/xml/UserXML/createAdd a user from an XML bodyAdd a user from an XML body. - DELETE
https://api.testingapis.com/api/xml/UserXML/delete/{id}Delete a userDelete a user. - PUT
https://api.testingapis.com/api/xml/UserXML/update/{id}Update a user's name, job and city from an XML bodyUpdate a user's name, job and city from an XML body.
请求示例
List all users as XML. 完整参考和 Send 按钮(英文).
cURL
curl -X GET "https://api.testingapis.com/api/xml/UserXML/all" \
-H "Accept: application/xml"响应 · 200 OK
<Users xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><User><Id>101</Id><Name>Hiroshi Tanaka</Name><Job>Engineer</Job><City>Tokyo</City></User><User><Id>102</Id><Name>Maria Gonzales</Name>…