Browse Source

Add static function request(url) (neko only)

Pascal Peridont 19 years ago
parent
commit
68b5d161ee
1 changed files with 15 additions and 0 deletions
  1. 15 0
      std/haxe/Http.hx

+ 15 - 0
std/haxe/Http.hx

@@ -244,4 +244,19 @@ class Http {
 	public function onStatus( status : Int ) {
 	}
 
+#if neko
+	public static function request( url : String ) : String {
+		var h = new Http(url);
+		var r = null;
+		h.onData = function(d){
+			r = d;
+		}
+		h.onError = function(e){
+			throw e;
+		}
+		h.request(false);
+		return r;
+	}
+#end
+
 }