- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- http get requests by commandline
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-21-2001 08:41 AM
тАО11-21-2001 08:41 AM
A password will be asked, so I'll have to give input, but in either case, it'd be nice to get some response anyway....
pereal:root> telnet pereal 4242
Trying...
Connected to pereal.guinness.ie.
Escape character is '^]'.
HTTP/1.0
HTTP/1.0 505 OK
MIME-Version: 1.0
Server: HP-ChaiServer/3.0
Date: Wed, 21 Nov 2001 16:37:46 GMT
Connection: close
Content-length: 100
Content-Type: text/html
Connection: close
Cannot process request, not implemen
ted at server.
Unknown HTTP actionConnection closed by foreign host.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-21-2001 08:43 AM
тАО11-21-2001 08:43 AM
Re: http get requests by commandline
On the Chai Server, a GET returns:
GET
HTTP/1.0 400 Unintelligible request line: GET
MIME-Version: 1.0
Server: HP-ChaiServer/3.0
Date: Wed, 21 Nov 2001 16:44:03 GMT
Connection: close
Content-length: 97
Content-Type: text/html
Connection: close
Bad request, cannot process. Unintelligible requ
est line: GETConnection closed by foreign host.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-21-2001 08:47 AM
тАО11-21-2001 08:47 AM
Re: http get requests by commandline
$ echo "GET /\n" | telnet
Regards,
Steve
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-21-2001 08:52 AM
тАО11-21-2001 08:52 AM
Re: http get requests by commandline
Trying...
Connected to pereal.guinness.ie.
Escape character is '^]'.
HTTP/1.0 400 Unintelligible request line: GET /
Just to mention, it will ask me for a password in a prompt box before loading a page, but I guess that must be loaded from within the homepage...
Later,
Bill
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-21-2001 08:54 AM
тАО11-21-2001 08:54 AM
Re: http get requests by commandline
print HTTP string | telnet machine 80
(For HTTP string - look at the RFC!)
But it's not always the best way - you could code it using netcat or expect...
Or, you can download snarf from the porting centre and use that (best way :-)
dave
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-21-2001 09:06 AM
тАО11-21-2001 09:06 AM
Re: http get requests by commandline
$ echo "GET / HTTP/1.0\n" | telnet
For the password stuff, if its just using basic authentication, you can include the encrypted user name and password in an Authorization header, eg:
echo "GET / HTTP/1.0\nAuthorization: Basic
From memory, the encryption is simply a base64 encoding of the username:password - check the HTTP RFC to be sure. Not so easy to generate from the shell, but theres always perl :)
Cheers,
Steve
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-21-2001 09:11 AM
тАО11-21-2001 09:11 AM
Re: http get requests by commandline
it allows authentication from commandline..
pereal:root> ./snarf -v ocmpadm:ocmpadm@pereal:4242
http://luser:passwd@pereal:4242 (unknown size)
index.html [\] 0K
609 bytes transferred in 0.00 sec (1392.78k/sec)
and:
pereal:root> ./snarf -v pereal:80
HTTP/1.1 200 OK
Date: Wed, 21 Nov 2001 17:11:34 GMT
Server: Apache/1.3.19 (Unix) ApacheJServ/1.1.1 PHP/4.0.4pl1
Last-Modified: Mon, 22 Oct 2001 11:15:57 GMT
ETag: "8470-692-3bd3ffed"
Accept-Ranges: bytes
Content-Length: 1682
Connection: close
Content-Type: text/html
http://pereal:80 (1K)
index.html [########################] 1K | 5401.39K/s
1682 bytes transferred in 0.00 sec (2841.61k/sec)
Later,
Bill
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-21-2001 09:15 AM
тАО11-21-2001 09:15 AM
Re: http get requests by commandline
Trying...
Connected to pereal.guinness.ie.
Escape character is '^]'.
HTTP/1.0 500 OK
MIME-Version: 1.0
Server: HP-ChaiServer/3.0
Date: Wed, 21 Nov 2001 17:15:14 GMT
Connection: close
Content-length: 108
Content-Type: text/html
Connection: close
Could not process request due to inter
nal server error.
Connection closed by foreign host.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-22-2001 06:51 PM
тАО11-22-2001 06:51 PM
SolutionIf you want to get, say, a page that is protected by a password, use WGET, like that:
wget --http-user bill --http-passwd mypassword URL
That does the job nicely and you don't have to deal with obscure echo commands. :)
Regards,
Paga
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-22-2001 07:45 PM
тАО11-22-2001 07:45 PM
Re: http get requests by commandline
Don't forget the good old lynx. :) A combination of either -dump or -source as well as -auth should be sufficient for your specified needs.
To get HTML source:
# lynx -auth=userid:passwd -source http://host.domain/your.url
To get HTML output:
# lynx -auth=userid:passwd -dump http://host.domain/your.url
Hope this helps. Regards.
Steven Sim Kok Leong
Brainbench MVP for Unix Admin
http://www.brainbench.com