HTML ping 请求的响应是什么
What is the response to an HTML ping request
我了解到,HTML 锚标签也可以带有 ping resource url,例如
<a href="https://example.com" ping="http://tracking.example.com/" >Website</a>
这将向 ping 的目标异步发送 post 请求。
但是 ping 目标应该用什么来响应?
- 单独的 HTML 页面?
- 某种形式的资源?
- 什么都没有?
- 状态码是什么?
浏览器应该如何处理响应(如果有)?
- 直接丢弃?
- 登录?
ping 目标响应根本不重要。 source
User agents must ignore any entity bodies returned in the responses. User agents may close the connection prematurely once they start receiving a response body.
因此您可以发送一个空的 204 无内容 响应。
我了解到,HTML 锚标签也可以带有 ping resource url,例如
<a href="https://example.com" ping="http://tracking.example.com/" >Website</a>
这将向 ping 的目标异步发送 post 请求。
但是 ping 目标应该用什么来响应?
- 单独的 HTML 页面?
- 某种形式的资源?
- 什么都没有?
- 状态码是什么?
浏览器应该如何处理响应(如果有)?
- 直接丢弃?
- 登录?
ping 目标响应根本不重要。 source
User agents must ignore any entity bodies returned in the responses. User agents may close the connection prematurely once they start receiving a response body.
因此您可以发送一个空的 204 无内容 响应。