在http1.1中request和reponse header中都有可能出現一個connection頭字段,此header的含義是當client和server通信時對於長鏈接如何進行處理。
在http1.1中,client和server都是默認對方支持長鏈接的, 如果client使用http1.1協議,但又不希望使用長鏈接,則需要在header中指明connection的值為close;如果server方也不想支持長鏈接,則在response中也需要明確說明connection的值為close.
參考:
https://www.cnblogs.com/liluxiang/p/9474907.html