200-901 · Question #536
How does a synchronous API request differ from an asynchronous API request?
The correct answer is A. clients are able to access the results immediately. Synchronous API requests require the client to wait for a complete response from the server before continuing its operations, making the results immediately accessible upon receipt.
Question
How does a synchronous API request differ from an asynchronous API request?
Options
- Aclients are able to access the results immediately
- Bclients subscribe to a webhook for operation results
- Cclients poll for the status of the execution of operations
- Dclients receive responses with a task ID for further processing
How the community answered
(27 responses)- A85% (23)
- B7% (2)
- C4% (1)
- D4% (1)
Why each option
Synchronous API requests require the client to wait for a complete response from the server before continuing its operations, making the results immediately accessible upon receipt.
In a synchronous API request, the client sends a request and blocks, waiting for the server to process the entire operation and return the final results directly in the response. This means the client receives and can immediately access the results upon the response's arrival.
Clients subscribing to a webhook for operation results is characteristic of an asynchronous API pattern, where the server notifies the client when the task is complete.
Clients polling for the status of operation execution is a method used with asynchronous API requests, where the initial response provides a task ID, and the client repeatedly checks the status using that ID.
Clients receiving responses with a task ID for further processing is typical of an asynchronous API, where the task ID is used for subsequent polling or webhook registration to retrieve the final result.
Concept tested: Synchronous vs Asynchronous API
Source: https://restfulapi.net/synchronous-asynchronous-apis/
Topics
Community Discussion
No community discussion yet for this question.