adding uri escaped xml as queryparam

Posted by aguilarsoto on Stack Overflow See other posts from Stack Overflow or by aguilarsoto
Published on 2014-08-19T22:18:00Z Indexed on 2014/08/19 22:20 UTC
Read the original article Hit count: 139

Filed under:

Hello and thanks for any support.

So I have an API that is expecting an escaped xml as part of the query params. so I tried a couple of things.

  1. <Set> <QueryParams> <QueryParam name="xml">%3CcreateSession%3E%3CapiKey+type%3D%22integer%22%3123123123123123123%3C%2FapiKey%3E%3C%2FcreateSession%3E</QueryParam> </QueryParams> </Set>

this actually gets extra escaped and we end up with an invalid xml

  1. <Set> <QueryParams> <QueryParam name="xml"> <createSession><apiKey type=\"integer\">123123123123</apiKey> </createSession> </QueryParam> </QueryParams> </Set>

this one is not even saved.

  1. <Payload variablePrefix="#" variableSuffix="#" contentType="application/json"> { 'xml': '<createSession><apiKey type=\"integer\">123123123123</apiKey></createSession>'} </Payload>

this is not helping me either.

so what would be the best way to add an xml to the params without getting extra escaped or escaped only once

© Stack Overflow or respective owner

Related posts about apigee