TestingAPIs is still being built. If something breaks, email support@testingapis.com.

Add a user from an XML body

POSThttps://api.testingapis.com/api/xml/UserXML/createSign in to see this endpoint's URL

Header: Content-Type: application/xml. Example body: <UserRequest><Name>Ana</Name><Job>Pilot</Job><City>Lisbon</City></UserRequest>

Request body

Optional. application/xml. Model: UserXmlRequest. A <UserRequest> element with Name, Job and City.

Example body
<UserRequest><Name>Priya</Name><Job>QA</Job><City>Pune</City></UserRequest>

Responses

201
The created user, with a Location header pointing at it.
400
Body missing or not valid XML.
415
Content-Type is not application/xml.

Example

Request
curl -X POST "https://api.testingapis.com/api/xml/UserXML/create" \
  -H "Content-Type: application/xml" \
  -H "Accept: application/xml" \
  -d '<UserRequest><Name>Priya</Name><Job>QA</Job><City>Pune</City></UserRequest>' \
  -H "X-TestingApis-Key: YOUR_API_KEY"
Response201 Created
Content-Type: application/xml; charset=utf-8
Location: https://api.testingapis.com/api/xml/UserXML/1001

<User xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><Id>1001</Id><Name>Priya</Name><Job>QA</Job><…

Sign in to see the details

The parameters, request and response examples and the live Try it panel for this endpoint are for signed-in members. Accounts are free and take a few seconds to create.