What is the difference between asynchronous and synchronous HTTP request?
HTTP is a synchronous protocol: the client issues a request and waits for a response. If you are using non-blocking (aka async) IO, the current thread of the client does not really have to wait, but can do other things (see above).
Asynchronous HTTP Request Processing is a relatively new technique that allows you to process a single HTTP request using non-blocking I/O and, if desired in separate threads. Some refer to it as COMET capabilities.
The HTTP asynchronous request-response behavior is asynchronous only because IBM® App Connect Enterprise treats the request and the response as such, enabling the message flow to retrieve the next message without waiting for the response from the asynchronous request.
XMLHttpRequest supports both synchronous and asynchronous communications. In general, however, asynchronous requests should be preferred to synchronous requests for performance reasons.
Synchronous: A synchronous request blocks the client until operation completes. In such case, javascript engine of the browser is blocked.
Asynchronous An asynchronous request doesn’t block the client i.e. browser is responsive. At that time, user can perform another operations also. In such case, javascript engine of the browser is not blocked.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With