14

I'm debugging my webserver, and I'd like to manually send HEAD requests to some web pages. Is there a way to do this in Firefox? Some extension perhaps.

I want to use firefox so that it can be part of a normal session (ie cookies set, logged in, etc). So things like curl aren't perfect.

Paul Biggar
  • 27,579
  • 21
  • 99
  • 152

6 Answers6

9

Another possiblity is opening up firebug (or making this into a greasemonkey script) and using javascript to send your HEAD request.

// 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 inherit the cookies and current session (authentication from .htaccess etc).

Way to use this:

  • Use the javascript: url method
  • Use the Firebug console (http://getfirebug.com/) to execute javascript on the page
  • Create a greasemonkey script that executes HEAD requests and displays the result
Christopher Tarquini
  • 11,176
  • 16
  • 55
  • 73
7

Live HTTP Headers can send arbitrary HTTP requests using its replay function. Though it's a bit fiddly. And as it's a HEAD request, there'll be no output to see locally (it's normally displayed in the browser window).

First you need to open up the Live HTTP Headers (LHH) window, do your request from the browser using GET, then select that request in the LHH window and choose Replay.... Then, in the window that pops up, change GET to HEAD and fiddle with the headers if you like.

Pressing Replay will make the request.

Christopher Orr
  • 110,418
  • 27
  • 198
  • 193
  • 1
    I only saw an option for POST or GET (not HEAD) using Live HTTP Headers on FF 3.6 on windows. So if this used to work, it doesn't now :( – Bert Lamb Apr 28 '10 at 17:37
  • Thanks for the downvote. While there's only an option for GET or POST by default in the drop-down, you can just type over those and enter whatever method you like. – Christopher Orr Apr 28 '10 at 20:44
2

This is a pretty old thread, but there is a firefox plugin called "Poster" that does what you want.

There is another plugin I've used called "Rest Client" that is also good.

Mike
  • 894
  • 12
  • 19
1

I don't know of any plugin but this page might be of some use to you

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

Christopher Tarquini
  • 11,176
  • 16
  • 55
  • 73
  • That is useful. Doesn't work on localhost though. The reason I was looking for a firefox plugin was so that I could be logged in normally etc, and would get my cookies and such right. – Paul Biggar Dec 29 '09 at 19:34
1

I believe that you can send head requests with Fiddler http://www.fiddler2.com/Fiddler2/version.asp

This seems to be a solution that works in firefox as an addon, called Modify Headers https://addons.mozilla.org/en-US/firefox/addon/967

Aaron M
  • 2,523
  • 1
  • 23
  • 38
0

Check out 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.
bobbyrne01
  • 6,295
  • 19
  • 80
  • 150