我正在调试我的Web服务器,想手动向某些Web页面发送HEAD请求。在Firefox中是否有这样的方法?或者是否有一些扩展可以实现呢。
我希望使用Firefox,以便它成为正常会话的一部分(即设置Cookie,登录等)。 因此像curl这样的工具并不完美。
// Added comments
var xmlhttp = new XmlHttpRequest();
xmlhttp.open("HEAD", "/test/this/page.php",true); // Make async HEAD request (must be a relative path to avoid cross-domain restrictions)
xmlhttp.onreadystatechange=function() {
if (xmlhttp.readyState==4) { // make sure the request is complete
alert(xmlhttp.getAllResponseHeaders()) // display the headers
}
}
xmlhttp.send(null); // send request
XmlHttpRequests继承了cookies和当前会话(来自.htaccess等的身份验证)。
使用方法:
这是一个比较旧的帖子,但有一个名为“Poster”的Firefox插件可以实现你想要的功能。
我曾使用过另一个插件叫做“Rest Client”,也不错。
我不知道有任何插件,但这个页面可能对你有所帮助
我相信您可以使用 Fiddler 发送头部请求http://www.fiddler2.com/Fiddler2/version.asp
这似乎是一个在 Firefox 中作为插件工作的解决方案,名为 Modify Headershttps://addons.mozilla.org/en-US/firefox/addon/967
请查看 Firefox 的 http-tool
..
https://addons.mozilla.org/en-US/firefox/addon/http-tool/
Aimed at web developers who need to debug HTTP requests and responses.
Can be extremely useful while developing REST based api.
Features:
* GET
* HEAD
* POST
* PUT
* DELETE
Add header(s) to request.
Add body content to request.
View header(s) in response.
View body content in response.
View status code of response.
View status text of response.