Question: why json is used in rest api?
Answer: JSON is commonly used for asynchronous communication between browsers and servers, the kind of communication performed by RESTful APIs and is favored over XML because it's cleaner and easier to work with.