Skip to main content
September 21, 2023
Question

xml Body parameter for webapi to test

  • September 21, 2023
  • 2 replies
  • 0 views

Hi,

I have an webapi which accepts xml as body request, So in order to test that webapi, I'm passing below xml:

<UserInformation>
<id>TestUser1</id>
<isAppianUser>true</isAppianUser>
<firstName>Test</firstName>
<lastName>User1</lastName>
<name>Test User 1</name>
<systemRole>{'Initiator','Manager'}</systemRole>
<market>Hong Kong</market>
</UserInformation>

But I'm getting below error when I test:



can anyone help me how to test webapi in this case.

2 replies

stefanhelzle0001
September 21, 2023

Can you share the code of your API implementation?

mathieud0001
September 22, 2023

Set "application/xml" as your content type?

I used the xmltojson function in the XML parser plugin.

a!fromJson(xmltojson(http!request.body))