dreamhead / moco

Easy Setup Stub Server
MIT License
4.35k stars 1.08k forks source link

返回值类型不支持xml #326

Closed xiao-peng-yu closed 7 months ago

xiao-peng-yu commented 1 year ago

image [ { "request" : { "uri":"/test", "method":"post" }, "response" : { "text" : "<?xml version="1.0" encoding="UTF-8" standalone="yes"?>" } } ] <?xml version="1.0" encoding="UTF-8" standalone="yes"?>

dreamhead commented 1 year ago

There are many " in your XML String which is illegal in JSON.

You can use XML file for your response.

HelloEason commented 1 year ago

use python lib json to fix it , copy the result to json file

import json
xml_in_json = json.dumps(xml_body)
print(xml_in_json)