Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

There's a way to redirect CURL output to Firefox?

Tags:

curl

firefox

I have a bunch of requests in my application that return html. So, there's a way to redirect the CURL output to my browser so it renders its content? Something like the code below (which does not work).

curl $MY_URL | firefox

Do you know any way of accomplish that?

like image 431
Jean Carlo Machado Avatar asked Apr 07 '15 19:04

Jean Carlo Machado


People also ask

How do I use curl in Firefox?

From Firefox You get the site shown with Firefox's network tools. You then right-click on the specific request you want to repeat in the “Web Developer->Network” tool when you see the HTTP traffic, and in the menu that appears you select “Copy as cURL”.

Can I use curl in browser?

curl can do almost every HTTP operation and transfer your favorite browser can. It can actually do a lot more than so as well, but in this chapter we will focus on the fact that you can use curl to reproduce, or script, what you would otherwise have to do manually with a browser.

How do I connect curl to my website?

The syntax for the curl command is as follows: curl [options] [URL...] In its simplest form, when invoked without any option, curl displays the specified resource to the standard output. The command will print the source code of the example.com homepage in your terminal window.

How do I follow curl redirect?

To follow redirect with Curl, use the -L or --location command-line option. This flag tells Curl to resend the request to the new address. When you send a POST request, and the server responds with one of the codes 301, 302, or 303, Curl will make the subsequent request using the GET method.


1 Answers

The following command worked for me using Cygwin (running under Win7) and Ubuntu 14.04.2:

curl http://www.rosstronics.biz | firefox "data:text/html;base64,$(base64 -w 0 <&0)"
like image 156
TL Couger Avatar answered Sep 19 '22 15:09

TL Couger