익명 22:46

How to open cURL in Firefox or other web browser?

How to open cURL in Firefox or other web browser?

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'


Top Answer/Comment:

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.

상단 광고의 [X] 버튼을 누르면 내용이 보입니다