test_class.file: http-client/src/test/java/com/alibaba/csb/sdk/CmdCallerTest.java
test_class.identifier: CmdCallerTest
test_case.body: @Test
      public void testCPost() {
          CmdCaller.main(new String[]{"cpost", "http://abc:123?a=b&c=abc", "testpost", "1.0.0", "ak", "sk", "abc"});
      }
test_case.class_method_signature: CmdCallerTest.testCPost()
test_case.full_signature: @Test public void testCPost()
test_case.identifier: testCPost
test_case.invocations: main
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testCPost()
focal_class.declarator: SDK_VERSION = "1.1.4"
focal_class.modifier: private static final
focal_class.original_string: private static final String SDK_VERSION = "1.1.4";
focal_class.type: String
focal_class.var_name: SDK_VERSION
focal_class.file: http-client/src/main/java/com/alibaba/csb/sdk/CmdCaller.java
focal_class.identifier: CmdCaller
focal_class.class_method_signature: CmdCaller.usage()
focal_class.full_signature: private static void usage()
focal_class.identifier: usage
focal_class.modifiers: private static
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void usage()
focal_class.class_method_signature: CmdCaller.main(String args[])
focal_class.full_signature: public static void main(String args[])
focal_class.identifier: main
focal_class.modifiers: public static
focal_class.parameters: (String args[])
focal_class.return: void
focal_class.signature: void main(String args[])
focal_class.class_method_signature: CmdCaller.loadProps(String propFile)
focal_class.full_signature: private static Properties loadProps(String propFile)
focal_class.identifier: loadProps
focal_class.modifiers: private static
focal_class.parameters: (String propFile)
focal_class.return: Properties
focal_class.signature: Properties loadProps(String propFile)
focal_class.class_method_signature: CmdCaller.readPropFile(String pfileKey)
focal_class.full_signature: private static Properties readPropFile(String pfileKey)
focal_class.identifier: readPropFile
focal_class.modifiers: private static
focal_class.parameters: (String pfileKey)
focal_class.return: Properties
focal_class.signature: Properties readPropFile(String pfileKey)
focal_method.body: public static void main(String args[]) {
  		try {
  			if (args.length > 0 && "-v".equalsIgnoreCase(args[0])) {
  				System.out.println("HttpCaller SDK version:" + SDK_VERSION);
  				try {
  					System.out.println(CommUtil.geCurrenttVersionFile());
  				} catch (IOException e) {
  					//e.printStackTrace();
  				}
  				return;
  			}
  			if (args.length != 4 && args.length != 6) {
  				usage();
  				return;
  			}
  			String method = args[0];
  			if (!"get".equalsIgnoreCase(method) && !"post".equalsIgnoreCase(method)
  					&& !"cget".equalsIgnoreCase(method) && !"cpost".equalsIgnoreCase(method)) {
  				usage();
  				return;
  			}
  
  			Properties headerProp = readPropFile("hfile");
  			Properties dataProp = readPropFile("dfile");
  
  			String lurl = args[1];
  			String apiName = args[2];
  			String version = args[3];
  
  			if ("null".equalsIgnoreCase(args[3]))
  				version = null;
  
  			String ak = null;
  			String sk = null;
  
  			System.out.println("---- restful request url:" + lurl);
  			System.out.println("---- apiName:" + apiName);
  			System.out.println("---- version:" + version);
  			System.out.println("---- method:" + method);
  
  			if (args.length == 6) {
  				ak = args[4];
  				sk = args[5];
  
  				if ("".equals(ak))
  					ak = null;
  				System.out.println("---- ak:" + ak);
  				System.out.println("---- sk:" + sk);
  			}
  			String ret = null;
  
  			boolean curlOnly = false;
  			if (method.toLowerCase().startsWith("c")) {
  				curlOnly = true;
  				HttpCaller.setCurlResponse(true);
  			}
  
  			HttpParameters.Builder builder = HttpParameters.newBuilder();
  			builder.api(apiName).version(version).method(method).requestURL(lurl).accessKey(ak).secretKey(sk);
  
  			if (headerProp != null) {
  				for (Entry<Object, Object> kv : headerProp.entrySet()) {
  					if ("NONCE".equalsIgnoreCase(String.valueOf(kv.getKey()))) {
  						//设置nonce flag
  						if("true".equalsIgnoreCase(String.valueOf(kv.getValue()))) {
  							System.out.println("---- set nonce as true ");
  							builder.nonce(true);
  						}
  					}
  					System.out.println("---- put http header " + (String) kv.getKey() + ":" + (String) kv.getValue());
  					builder.putHeaderParamsMap((String) kv.getKey(), (String) kv.getValue());
  				}
  			}
  			if (dataProp != null) {
  				for (Entry<Object, Object> kv : dataProp.entrySet()) {
  					System.out.println("---- put data body " + (String) kv.getKey() + ":" + (String) kv.getValue());
  					builder.putParamsMap((String) kv.getKey(), (String) kv.getValue());
  				}
  			}
  			StringBuffer resHttpHeaders = new StringBuffer();
  			ret = HttpCaller.invoke(builder.build(), resHttpHeaders);
  
  			if (curlOnly) {
  				System.out.println("---- curlString = " + ret);
  			} else {
  				System.out.println("---- response http headers = " + resHttpHeaders.toString());
  				System.out.println("---- retStr = " + ret);
  
  				//call multi-times for stress or flow-ctrl testing
  				int times = Integer.getInteger("test.stress.times",0);
  				for(int i=2; i<=times; i++) {
  					ret = HttpCaller.invoke(builder.build(), resHttpHeaders);
  					System.out.println("---- retStr [#"+i+"] = " + ret);
  				}
  			}
  			
  			System.out.println();
  			//System.exit(0);
  		} catch (HttpCallerException e) {
  			System.out.println("---- sdk invoke error:" + e.getMessage());
  		}
  	}
focal_method.class_method_signature: CmdCaller.main(String args[])
focal_method.full_signature: public static void main(String args[])
focal_method.identifier: main
focal_method.invocations: equalsIgnoreCase println println geCurrenttVersionFile usage equalsIgnoreCase equalsIgnoreCase equalsIgnoreCase equalsIgnoreCase usage readPropFile readPropFile equalsIgnoreCase println println println println equals println println startsWith toLowerCase setCurlResponse newBuilder secretKey accessKey requestURL method version api entrySet equalsIgnoreCase valueOf getKey equalsIgnoreCase valueOf getValue println nonce println getKey getValue putHeaderParamsMap getKey getValue entrySet println getKey getValue putParamsMap getKey getValue invoke build println println toString println getInteger invoke build println println println getMessage
focal_method.modifiers: public static
focal_method.parameters: (String args[])
focal_method.return: void
focal_method.signature: void main(String args[])