fetch multimethod

Methods

fetch(filename:Str, decode_hints:Hash={}) Source: stdlib.ngs:5857
read() and decode() the given file

Example

fetch("1.json")  # Data structure, the parsed JSON
fetch(url:Str, decode_hints:Hash={}) Source: stdlib.ngs:5865
Fetch HTTP(S) file and decode() it

Example

fetch('https://api.myip.com')  # Data structure, the parsed JSON
fetch(decode_hints:Hash={}) Source: stdlib.ngs:5871
Read standard input and decode() it, passing "source" equals "stdin" hint.

Example

fetch()  # Data structure, parsed stdin
fetch(p:Path, decode_hints:Hash={}) Source: stdlib.ngs:5875
read() and decode() the given file

Example

fetch(File("1.json"))  # Data structure, the parsed JSON
fetch(f:MaybeFile, decode_hints:Hash={}, dflt:Any=null)
Fetches the file using previously defined fetch()

Returns

Like fetch(File, ...) or dflt if the file is not present.