weixin_33725515 2018-09-10 07:15 采纳率: 0%
浏览 62

HTTP同步性质

I have read that HTTP is a synchronous protocol. Client sends a request and wait for a response. Client has wait for the first response before sending the next request. Ajax uses HTTP protocol but is asynchronous in contrast. I also read that Asynchronous request blocks the client until operation complete from here. I am confused and my quesetion are:
1. what is definition of synchronous when talking about HTTP Protocol?
2. Does synchronous associated with blocking?

  • 写回答

2条回答 默认 最新

  • weixin_33743248 2018-09-10 07:31
    关注

    Asynchronous means, you do an HTTP request, but you are not waiting until the answer arrives. You will handle it, when it arrives and are free to do other stuff in between. Meaning: You are not blocking your application from doing anything else.

    Synchronous on the other Hand means, you do a request and wait for the answer before you do anything else. Meaning: You are blocking your application from doing anything else.

    评论

报告相同问题?