Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

From what I can understand of LSB documentation, neither wget or netcat are standard tools always available in an LSB environment.

Is there some other way to make a http request without being dependent on anything else than LSB?
What would be the most safe tool to be dependent on if I want to make it as simple as possible for users of my tool?

share|improve this question

2 Answers 2

up vote 1 down vote accepted

I see that the LSB includes both Perl and Python...Python, at least, includes http tools in the standard library. I didn't investigate to see if the LSB mandates libwww-perl.

If you don't want to write anything yourself and you're happy with output to stdout, you can do this:

python -murllib http://example.com/

And if you're feeling really motivated, you can write a simple http client in bash.

share|improve this answer
    
RedHat and its clones use python for the package-management - good hint. –  Nils Mar 25 '12 at 20:07
    
If you have libwww-perl installed then you can also type GET http://foo.com . There are also options for POST and HEAD. –  JodieC Mar 25 '12 at 20:55
    
...hence my question about whether or not the LSB mandates libwww-perl. –  larsks Mar 25 '12 at 21:13
    
Actually I don't see nor python nor perl in lsb spec commands list ( refspecs.linuxfoundation.org/LSB_4.1.0/LSB-Core-generic/… ) or even in whole spec ( refspecs.linuxfoundation.org/LSB_4.1.0/LSB-Core-generic/… ). Can you please show me the place where lsb incudes both perl and python? –  rush Mar 25 '12 at 21:57
    
I was looking at this page, but it was a quick look... –  larsks Mar 25 '12 at 22:12

LSB is just Linux - and that might be an embedded device with not network at all. So there is no need to define HTTP in LSB.

Apart from that wget should be pretty standard in most distributions (e.g. SuSE uses wget in SuSEregister). Another tool might be curl - but you can not depend on these tools being available.

So if you want to use it - build a proper package and define a dependency (required: wget).

I see no other way for this.

share|improve this answer
    
Indeed. Then again the LSB includes sendmail and lp. But I don't think it includes any way to do HTTP. –  Gilles Mar 25 '12 at 23:07

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.