How to open cURL in Firefox or other web browser?

14,287

cURL is not part of Firefox or Firebug, i.e. it cannot be executed there. As the Firebug wiki explains:

cURL is a command line tool for transferring data with URL syntax. Firebug's Copy As cURL command recreates the HTTP request (including HTTP headers and query string parameters) and copies it as a cURL command string to the clipboard. The string can be pasted into a terminal window to execute the same request or for example pasted to a client that supports cURL. In cases where the server serves compressed responses the preference extensions.firebug.net.curlAddCompressedArgument can be set to true and Firebug will add the --compressed argument to the generated command string.

It also refers to the cURL homepage.

What Firebug offers is to resend the right-clicked request via the Resend option within the context menu.

Share:
14,287

Related videos on Youtube

Sebastian Zartner
Author by

Sebastian Zartner

I was a member of the Firebug Working Group. I like to program in JavaScript, ColdFusion and PHP. Currently I am working on improving the Firefox DevTools and a Firefox extension called Regular Expressions Tester (TRex). Furthermore I'm helping to document on the Mozilla Developer Network (MDN) and giving some input to the Inkscape team. I am also an invited expert of the W3C, providing some feedback in regard of the CSS standards and helping to shape the specifications.

Updated on September 18, 2022

Comments

  • Sebastian Zartner
    Sebastian Zartner over 1 year

    I have Firebug installed in Firefox. In the Net panel there are all network requests listed. When I right-click and choose Copy as cURL, how do I use this cURL?

    How can I repeat my POST request data using cURL?

    The copied cURL looks like this:

    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'
    
    • David Betz
      David Betz about 8 years
      What is your OS? *nix? copy/paste into your shell. Windows? You can recreate in Fiddler. Other? Just hit replay it in Firebug.
    • Ronnie Royston
      Ronnie Royston over 7 years
      How To Bypass CORS Errors On Chrome And Firefox For Testing if CORS is issue. Otherwise CORS equivalent is traditionally built in XHR, new way appears to be fetch api.