HTTP: Difference between revisions
Content added Content deleted
imported>Gabrielsroka |
(→{{header|Sidef}}: use "HTTP::Tiny", which is a core module) |
||
Line 2,643: | Line 2,643: | ||
=={{header|Sidef}}== |
=={{header|Sidef}}== |
||
Sidef can load and use Perl modules: |
Sidef can load and use Perl modules: |
||
<syntaxhighlight lang="ruby"> |
<syntaxhighlight lang="ruby">require('HTTP::Tiny') |
||
⚫ | |||
func get(url) { |
|||
try { require('LWP::UserAgent') } |
|||
⚫ | |||
catch { warn "'LWP::UserAgent' is not installed!"; return nil } |
|||
⚫ | |||
) |
|||
if (resp{:success}) { |
|||
⚫ | |||
return resp{:content}.decode_utf8 |
|||
return resp.decoded_content |
|||
} |
} |
||
return nil |
return nil |
||
} |
} |
||
say get("http://rosettacode.org")</syntaxhighlight> |
|||
=={{header|Smalltalk}}== |
=={{header|Smalltalk}}== |