אירוע
בניית אפליקציות וסוכנים של בינה מלאכותית
17 במרץ, 21 - 21 במרץ, 10
הצטרף לסידרה של פגישות כדי לבנות פתרונות מדרגיים של בינה מלאכותית בהתבסס על מקרי שימוש מהעולם האמיתי עם מפתחים ומומחים אחרים.
הירשם עכשיוהדפדפן הזה אינו נתמך עוד.
שדרג ל- Microsoft Edge כדי לנצל את התכונות, עדכוני האבטחה והתמיכה הטכנית העדכניים ביותר.
APPLIES TO: All API Management tiers
The xml-to-json
policy converts a request or response body from XML to JSON. This policy can be used to modernize APIs based on XML-only backend web services.
הערה
Set the policy's elements and child elements in the order provided in the policy statement. Learn more about how to set or edit API Management policies.
<xml-to-json kind="javascript-friendly | direct" apply="always | content-type-xml" consider-accept-header="true | false" always-array-child-elements="true | false"/>
Attribute | Description | Required | Default |
---|---|---|---|
kind | The attribute must be set to one of the following values. - javascript-friendly - the converted JSON has a form friendly to JavaScript developers.- direct - the converted JSON reflects the original XML document's structure.Policy expressions are allowed. |
Yes | N/A |
apply | The attribute must be set to one of the following values. - always - convert always.- content-type-xml - convert only if response Content-Type header indicates presence of XML.Policy expressions are allowed. |
Yes | N/A |
consider-accept-header | The attribute must be set to one of the following values. - true - apply conversion if JSON is requested in request Accept header.- false -always apply conversion.Policy expressions are allowed. |
No | true |
always-array-child-elements | The attribute must be set to one of the following values. - true - Always convert child elements into a JSON array.- false - Only convert multiple child elements into a JSON array. Convert a single child element into a JSON object.Policy expressions are allowed. |
No | false |
<policies>
<inbound>
<base />
</inbound>
<outbound>
<base />
<xml-to-json kind="direct" apply="always" consider-accept-header="false" />
</outbound>
</policies>
For more information about working with policies, see:
אירוע
בניית אפליקציות וסוכנים של בינה מלאכותית
17 במרץ, 21 - 21 במרץ, 10
הצטרף לסידרה של פגישות כדי לבנות פתרונות מדרגיים של בינה מלאכותית בהתבסס על מקרי שימוש מהעולם האמיתי עם מפתחים ומומחים אחרים.
הירשם עכשיו