如何使用Firefox手动发送HEAD请求?

时间:2009-12-29 19:30:04

标签: http firefox request head

我正在调试我的网络服务器,我想手动将HEAD请求发送到某些网页。有没有办法在Firefox中执行此操作?也许有些扩展。

我想使用firefox,以便它可以成为正常会话的一部分(即设置cookie,登录等)。所以像卷曲这样的东西并不完美。

6 个答案:

答案 0 :(得分:9)

另一种可能性是打开firebug(或将其变成一个greasemonkey脚本)并使用javascript发送你的HEAD请求。

// 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继承cookie和当前会话(来自.htaccess等的身份验证)。

使用方法:

  • 使用javascript:url方法
  • 使用Firebug控制台(http://getfirebug.com/)在页面上执行javascript
  • 创建执行HEAD请求并显示结果的greasemonkey脚本

答案 1 :(得分:7)

Live HTTP Headers可以使用其重播功能发送任意HTTP请求。虽然它有点繁琐。由于这是一个HEAD请求,因此本地没有输出(通常显示在浏览器窗口中)。

首先,您需要打开Live HTTP Headers(LHH)窗口,使用GET从浏览器执行请求,然后在LHH窗口中选择该请求并选择 Replay ... 。然后,在弹出的窗口中,将GET更改为HEAD并根据需要调整标题。

重播将发出请求。

答案 2 :(得分:2)

这是一个非常古老的主题,但有一个名为“Poster”的firefox插件可以满足您的需求。

我使用的另一个名为“Rest Client”的插件也很好。

答案 3 :(得分:1)

我不知道任何插件,但此页面可能对您有用

http://www.askapache.com/online-tools/http-headers-tool

答案 4 :(得分:1)

我相信你可以向Fiddler发送头部请求 http://www.fiddler2.com/Fiddler2/version.asp

这似乎是一个在firefox中作为插件工作的解决方案,称为修改标头 https://addons.mozilla.org/en-US/firefox/addon/967

答案 5 :(得分:0)

查看http-tool for firefox ..

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.
相关问题