What is the difference between asynchronous and synchronous HTTP request?
-
possible duplicate of http://stackoverflow.com/questions/7101758/performance-difference-between-synchronous-http-handler-and-asynchronous-http-ha – Dhaval Marthak May 23 '13 at 13:38
-
1Welcome to SO. You may want to read the [FAQ](http://stackoverflow.com/faq) on the types of questions to ask here. Specific programming questions with code examples. General questions such as this are better suited to
Spend a bit of time researching the question and if you can truely find no answer then ask but show some work on your part, don't expect the community here to help you if you're not willing to help yourself. – xQbert May 23 '13 at 13:40 -
possible duplicate of [Determining synchronous vs. asynchronous in web applications](http://stackoverflow.com/questions/5971301/determining-synchronous-vs-asynchronous-in-web-applications) – hek2mgl May 24 '13 at 15:47
5 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.

- 725
- 5
- 4
-
24Synchronous / Asynchronous communication has nothing to do with application waiting or not for resources. Synchronous communication is when communication looks like ping-pong one request and one response in that particular order. Asynchronous communication is when there could be multiple requests and responses could return in random order. – Logman May 31 '17 at 11:36
-
I agree. A blocking call is only one factor in the entire scenario and it is a client-side issue. The other side of the equation is the server-side, which has to be re-architected to accommodate this pattern. – Najeeb Dec 06 '17 at 08:33
-
2This answer has > 50 thumbs up, and expresses something reasonable. However, @Logman's comment - as much reasonable as the answer - claims the answer is plainly wrong. This is highly misleading for the reader. I have flagged the question for moderator intervention, but it was rejected. – Enlico Jan 15 '20 at 23:16
Check out Determining synchronous vs. asynchronous in web applications for previous discussion. In short:
Asynchronous APIs do not block. Every synchronous call waits and blocks for your results to > come back. This is just a sleeping thread and wasted computation.

- 1
- 1

- 324
- 2
- 11
Asynchronous APIs do not block. Every synchronous call waits and blocks for your results to come back. This is just a sleeping thread and wasted computation.
If you need something to happen, send an asynchronous request and do further computation when the request returns. This means your thread sits idle and can pick up other work.
Asynchronous requests is the way to scale to thousands of concurrent users.

- 97
- 1
- 6
Sachin Gandhwani's answer is very well explained in simple words. In case you are still not convinced with the difference of asynchronous HTTP request and synchronous HTTP request, you can read this - https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/Synchronous_and_Asynchronous_Requests

- 41
- 5
-
1links are not permanent so try to post the necessary solution for the query. – Ratan Uday Kumar Jul 19 '19 at 06:18
A synchronous client constructs an HTTP structure, sends a request, and waits for a response. An asynchronous client constructs an HTTP structure, sends a request, and moves on. In this case, the client is notified when the response arrives. The original thread, or another thread, can then process the response. Although asynchronous behavior can result in faster overall execution, synchronous behavior might be preferred in certain cases where more simplified code is necessary.

- 370
- 4
- 12