import java.io.BufferedReader;
import java.io.DataOutputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintStream;
import java.net.HttpURLConnection;
import java.net.URL;

public class LoadValidatePostedZip {
	public static void main(String[] args) throws IOException {
		String restAPIstr =
			"http://localhost:8080/rest/xbrl/" + 
			"instance.xbrl" +
			"/validation/xbrl?media=text&flavor=sec";
		URL url = new URL(restAPIstr);
		HttpURLConnection conn =
		      (HttpURLConnection) url.openConnection();
		conn.setRequestMethod("POST");
		conn.setRequestProperty("Content-Type",
				"application/zip");
		conn.setDoOutput(true);
	    //Send request
		File zipFile = new File("C:/temp/test.zip");
		InputStream is = new FileInputStream(zipFile);
		byte[] zipFileBytes = new byte[1000000];
		int countRead = is.read(zipFileBytes, 0, 1000000);
		is.close();

		DataOutputStream wr = new DataOutputStream (
				conn.getOutputStream ());
		wr.write(zipFileBytes, 0, countRead);
		wr.flush ();
		wr.close ();
		
		if (conn.getResponseCode() != 200) {
		    throw new IOException(conn.getResponseMessage());
		}

		// Buffer the result into a string
		BufferedReader rd = new BufferedReader(
		      new InputStreamReader(conn.getInputStream()));
		StringBuilder sb = new StringBuilder();
		String line;
		while ((line = rd.readLine()) != null) {
		    sb.append(line);
			System.out.println(line);
		}
		rd.close();
		conn.disconnect();
	}
}

@@ -462,12 +462,27 @@
 ance
-.xbr
+-no-formula-link.xm
 l%22 +
@@ -502,16 +502,24 @@
 ion/xbrl
+%22 +%0A%09%09%09%22
 ?media=t
@@ -525,19 +525,84 @@
 text
-&flavor=sec
+%22 +%0A%09%09%09%22&import=assertionsHtmlSchemaLoc.xml%22 +%0A%09%09%09%22&formulaAsserResultCounts
 %22;%0A%09
@@ -894,16 +894,34 @@
 emp/test
+-assertion-example
 .zip%22);%0A

change loadValidatePostedZip java example to use separate imported formula linkbase for testing purposes