Как открыть cURL в Firefox или другом веб-браузере?

4111
Patrioso

У меня Firebug установлен в Firefox. В панели Net перечислены все сетевые запросы. Когда я щелкаю правой кнопкой мыши и выбираю Копировать как cURL, как мне использовать этот cURL?

Как я могу повторить данные моего POST-запроса, используя cURL?

Скопированный cURL выглядит так:

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' 
0
Какая у тебя ОС? * Никс? скопировать / вставить в вашу оболочку. Окна? Вы можете воссоздать в Fiddler. Другой? Просто нажмите «Воспроизвести» в Firebug. David Betz 8 лет назад 1
[Как обойти ошибки CORS в Chrome и Firefox для тестирования] (http://pointdeveloper.com/how-to-bypass-cors-errors-on-chrome-and-firefox-for-testing/), если возникает проблема с CORS. В противном случае CORS-эквивалент традиционно строится в XHR, а новый способ - это выборка api. Ron Royston 7 лет назад 0

1 ответ на вопрос

0
Sebastian Zartner

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.

Похожие вопросы