Subscribe to RSS Feed

There are many cases when web developer needs to resend an existing HTTP request (executed by the currently debugged page) and test the server back-end or perhaps even a specific web service.

Such action can be often repeated, and so the task should be simple and quick.

Firebug offers several ways how to resend HTTP request, read more if you are interested...

Resend Action

The first and obvious way is to use Resend action that is available in the Net and Console panel context menu. It's the simplest method, just right click on an HTTP request in the Net panel or on XHR log in the Console panel and pick the Resend menu item.

You should see a new request displayed. Both requests will be the same since Firebug preserves headers, posted data, etc.

You can use this test page to try it yourself.

The URL of the webservice is:

http://www.softwareishard.com/firebug/tips/resend/hello.php

...and the implementation looks like as follows:

<?php
if (isset($_POST["name"]))
  echo "Hello ".$_POST["name"]."!";
else
  echo "Hello!";
?>

Copy as cURL

You might prefer OS system command line and its cURL command line tool.

A simple example first. To get the response from our hello.php service you need to execute:

curl http://www.softwareishard.com/firebug/tips/resend/hello.php

In order to get the cURL command for an existing HTTP request, right click on the request in the Net or Console panel and pick Copy as cURL action. Firebug will copy it with all necessary arguments to the clipboard (preserving headers, etc.)

The result in our case is:

curl 'http://www.softwareishard.com/firebug/tips/resend/hello.php' -H 'Host: www.softwareishard.com' -H 'User-Agent: Mozilla/5.0 (Windows NT 6.0; rv:26.0) Gecko/20100101 Firefox/26.0' -H 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8' -H 'Accept-Language: en-US,en;q=0.5' -H 'Accept-Encoding: gzip, deflate' -H 'Content-Type: application/x-www-form-urlencoded; charset=UTF-8' -H 'Referer: http://www.softwareishard.com/firebug/tips/resend/resend.html' --data 'name=Bob'

Command Editor

The third option is using Firebug Command Editor and execute XHR with pure JavaScript. In this case you might specify headers and other options just as you like it.

Just open Firebug UI and select the Console panel on the page you are debugging.

 
 

  • Would you be interested to have another way to resend a request?
  • Would it be useful to have also Copy as Wget? If yes star this issue, so we know how high priority it is for us.

 

 

Rss Commenti

1 Comment

  1. Firebug is sensational. In fact it is that good, I will tolerate the current 3-5 second lag when switching to a tab with Firebug enabled. That's surely a sign that it is indispensable! 🙂

    Another major tribute to Firebug is the amount of resources Mozilla has dedicated to trying to replicate it ... and so far, many months later, it still cant! Not even close.

    Each and every time I try another browser's developer tools (which would probably never have been developed without Firebug's creation), I find annoyances in their own native developer tools that just do not exist in Firebug.

    Long live Firebug!

    #1 pd

Sorry, the comment form is closed at this time.