Makes an HTTP call and returns response as InputStream.

Configuration keys:

  • method - HTTP method as defined in, defaults to GET.
  • url - Request URL, interpolated.
  • headers - An optional map of request headers.
  • body - An optional request body.
  • success-code - Success code, defaults to 200.
  • connect-timeout - Connect timeout in seconds. Defaults to 60.
  • read-timeout - Read timeout in seconds. Defaults to 60.


YAML specification

   url: ${nasdanika}/hello-world.txt

or, because url is the only defined attribute:

http: ${nasdanika}/hello-world.txt

HTTP Call with just URL as shown in the snippets above has the same behavior as resource with a URL with http(s) protocol. resource supports additional protocols.

Java code

ObjectLoader loader = new org.nasdanika.exec.Loader();
ProgressMonitor monitor = new PrintStreamProgressMonitor(System.out, 0, 4, false);
Object httpCall = loader.loadYaml(specURL, monitor);

// For token replacement in the URL		
Context context = Context.singleton("nasdanika", "");		

InputStream response = callSupplier(context, monitor, httpCall);