Can I create REST API with XML as response? I know how to create and return JSON as response but not sure about XML
Data types that REST API can return are as follows: JSON (JavaScript Object Notation) XML. HTML.
REST stands for Representational State Transfer. It is a software architecture style that relies on a stateless communications protocol, most commonly, HTTP. REST structures data in XML, YAML, or any other format that is machine-readable, but usually JSON is most widely used.
Starting in version 2022-07, support for the XML response format and XML payloads in the Admin REST API is removed. Requests expecting an XML response will result in a 404. Requests that send an XML payload will result in a 415.
It allows different messaging formats, such as HTML, JSON, XML, and plain text, while SOAP only allows XML. REST is also a more lightweight architecture, so RESTful web services have better performance.
Yeah; you always could create a REST API with XML as response. How can I respond in XML using ExpressJS?
How to response data as xml in node.js instead of json
Expressjs response as JSON and Xml
Also when asking a question first go through stack overflow to check if same question asked.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With