Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the difference between asynchronous and synchronous HTTP request?

Tags:

webserver

What is the difference between asynchronous and synchronous HTTP request?

like image 302
Abhimanyu Kumar Avatar asked May 23 '13 13:05

Abhimanyu Kumar


People also ask

Is HTTP request synchronous or asynchronous?

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).

What is asynchronous HTTP?

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.

Why is http request asynchronous?

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.

Should HTTP requests be asynchronous?

XMLHttpRequest supports both synchronous and asynchronous communications. In general, however, asynchronous requests should be preferred to synchronous requests for performance reasons.


1 Answers

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.

like image 141
Sachin Gandhwani Avatar answered Oct 12 '22 19:10

Sachin Gandhwani