John Von Essen on 29 Jan 2019 10:07:23 -0800


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: [PLUG] raw GET requests


Well, in Perl you can use the libwww modules (LWP), in bash you’d have to just use command line tools like curl or wget and then redirect output into whatever code logic your doing.

I would manually do the request in curl by hand first, i.e. # curl http://domain.com/query.cgi\?q=abc123 to make sure you get HTML output (you have to backslash special chars like ?). 

The other option is to telnet to the host on port 80 and type:

GET /

Then hit enter and see what output you get. If that hangs, then yes, something is wrong with the server.

Some sites restrict manual GET requests, like Google, so its possible a manual GET from command line may sort of fail by design, but you will at least get HTML output giving the error.

-John


On Jan 29, 2019, at 12:54 PM, Michael Lazin <microlaser@gmail.com> wrote:

I had to troubleshoot problems with an externally hosted website so I could provide the host with salient information.  I was able to successfully run the "host" command and test the ports with netcat and they responded, and I used this article to put together a perl script to make a raw GET request to hopefully have it spit out an error:


I think the site is just hanging because wget, lynx-dump and my script hangs, but I was wondering how to make a raw GET request in bash?  what is the syntax?

Thanks,

Michael Lazin

--
Michael Lazin

to gar auto estin noein te kai ennai
___________________________________________________________________________
Philadelphia Linux Users Group         --        http://www.phillylinux.org
Announcements - http://lists.phillylinux.org/mailman/listinfo/plug-announce
General Discussion  --   http://lists.phillylinux.org/mailman/listinfo/plug

___________________________________________________________________________
Philadelphia Linux Users Group         --        http://www.phillylinux.org
Announcements - http://lists.phillylinux.org/mailman/listinfo/plug-announce
General Discussion  --   http://lists.phillylinux.org/mailman/listinfo/plug