What is an API and how does REST work?

Computer Science

ScanSolve AI Answer

An API (Application Programming Interface) lets software systems communicate. REST APIs use HTTP methods: GET (read), POST (create), PUT/PATCH (update), DELETE (remove). Example: GET /api/users returns a list of users. POST /api/users with JSON body creates a new user. Response includes status codes: 200 (OK), 201 (created), 400 (bad request), 404 (not found), 500 (server error). REST is stateless — each request contains all info needed. Data format is typically JSON.

Was this helpful?

Still stuck on this one?

Ask a follow-up, and the answer starts from this question.

Got a different question?Ask your own question