Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can I create REST API with XML as response?

Tags:

rest

node.js

xml

Can I create REST API with XML as response? I know how to create and return JSON as response but not sure about XML

like image 466
Tarun Nagpal Avatar asked Apr 28 '17 04:04

Tarun Nagpal


People also ask

CAN REST API have XML response?

Data types that REST API can return are as follows: JSON (JavaScript Object Notation) XML. HTML.

Can REST be in XML?

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.

Does REST support XML payloads?

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.

CAN REST API use XML and JSON?

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.


1 Answers

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.

like image 160
rt.jar Avatar answered Oct 30 '22 07:10

rt.jar