开发者

How do I send a HEAD request manually using Firefox?

开发者 https://www.devze.com 2022-12-14 21:29 出处:网络
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'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 l开发者_C百科ike curl aren't perfect.


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


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.


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.


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


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


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.
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号