Skip to content
Middle5 views

What format is used for data exchange in REST?

Practice

AI answer

REST itself does not define a data format. Usually, the client and server exchange HTTP requests and responses, with the body sent as JSON; XML, plain text, and other formats are also used. The format is usually specified with the Content-Type header, while supported formats are specified with Accept. For example: Content-Type: application/json.