diff core/src/luan/modules/IoLuan.java @ 283:b669cdaf54b7

add URL post; add Http.request.query_string; add web_run.form(); git-svn-id: https://luan-java.googlecode.com/svn/trunk@284 21e917c8-12df-6dd8-5cb6-c86387c605b9
author fschmidt@gmail.com <fschmidt@gmail.com@21e917c8-12df-6dd8-5cb6-c86387c605b9>
date Tue, 02 Dec 2014 03:34:04 +0000
parents a1fa4fba99de
children a50e88d3547c
line wrap: on
line diff
--- a/core/src/luan/modules/IoLuan.java	Wed Nov 26 22:25:09 2014 +0000
+++ b/core/src/luan/modules/IoLuan.java	Tue Dec 02 03:34:04 2014 +0000
@@ -343,6 +343,22 @@
 		@Override public String to_string() {
 			return url.toString();
 		}
+
+		public String post(String postS) throws IOException {
+			return new UrlCall(url).post(postS);
+		}
+
+		@Override LuanTable table() {
+			LuanTable tbl = super.table();
+			try {
+				tbl.put( "post", new LuanJavaFunction(
+					LuanUrl.class.getMethod( "post", String.class ), this
+				) );
+			} catch(NoSuchMethodException e) {
+				throw new RuntimeException(e);
+			}
+			return tbl;
+		}
 	}
 
 	public static final class LuanFile extends LuanIO {