package com.sipstacks.script;
import java.net.HttpURLConnection;
import java.net.URL;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.IOException;


public class GetFunction extends ExternalFunction {
	
	public String run(String args) {
		URL url;
		HttpURLConnection conn;
		BufferedReader rd;
		String line;
		String result = "";
		try {
			url = new URL(args);
			conn = (HttpURLConnection) url.openConnection();
			conn.setRequestMethod("GET");
			conn.setRequestProperty("Accept", "application/json");
			conn.setRequestProperty("User-Agent", "Apache-HttpClient/4.1.1 (java 1.5)");
			rd = new BufferedReader(new InputStreamReader(conn.getInputStream()));
			while ((line = rd.readLine()) != null) {
				result += line;
			}
			rd.close();
		} catch (IOException e) {
			return e.getMessage();
		} catch (Exception e) {
			e.getMessage();
		}
		return result;
	}
}

@@ -172,16 +172,39 @@
 eption;%0A
+import java.util.List;%0A
 %0A%0Apublic
@@ -270,22 +270,28 @@
 ing run(
+List%3C
 String
+%3E
  args) %7B
@@ -386,16 +386,82 @@
 t = %22%22;%0A
+%0A%09%09if (args.size() == 0) %7B%0A%09%09%09return %22Get() requires 1 arg%22;%0A%09%09%7D%0A%0A
 %09%09try %7B%0A
@@ -481,16 +481,23 @@
 URL(args
+.get(0)
 );%0A%09%09%09co

fix get() function