xml()
Sets an XML response body. Appends a Content-Type: text/xml
header on the response.
Call signature
1function xml(data: string): MockedResponse
Examples
1rest.get('/user', (req, res, ctx) => {2 return res(3 ctx.xml(`4<user>5 <id>abc-123</id>6 <firstName>John</firstName>7 <lastName>Maverick</lastName>8</user>9 `),10 )11})