Http

class haxe.HttpAvailable in flash8, flash, neko, js, php, cpp, cs, java var async : BoolAvailable in jsFor JS target, default to true. var cnxTimeout : FloatAvailable in neko, php, cpp, cs, java var noShutdown : BoolAvailable in neko, php, cpp, cs, java var responseData(default,null) : Null<String> var responseHeaders : StringMap<String>Available in neko, php, cpp, cs, java var url : String function new( url : String ) : Void function customRequest( post : Bool, api : Output, ?sock : AbstractSocket, ?method : String ) : VoidAvailable in neko, php, cpp, cs, java function fileTransfert( argname : String, filename : String, file : Input, size : Int ) : VoidAvailable in neko, php, cpp, cs, java dynamic function onData( data : String ) : VoidShould be replaced with code to handle the server's response. dynamic function onError( msg : String ) : VoidShould be replaced with error handling code. dynamic function onStatus( status : Int ) : VoidShould be replaced with status change handling code. function request( ?post : Bool ) : VoidInitiates the request. function setHeader( header : String, value : String ) : Http function setParameter( param : String, value : String ) : HttpSets a parameter to be sent in the request. Multiple parameters can be set by making multiple setParameter calls. function setPostData( data : String ) : HttpAvailable in flash, neko, js, php, cpp, cs, java static var PROXY : { port : Int, host : String, auth : { user : String, pass : String } }Available in neko, php, cpp, cs, java static function requestUrl( url : String ) : StringAvailable in neko, js, php, cpp, cs, javaMake a request and return the server's response.
version #16348, modified 2013-02-24 23:51:32 by api
1 comment
  • Asger Ottar Alstrup
    Dec 08, 2008 at 13:28

    To set a cookie in a request, use something like

    ''
    var h = new haxe.Http(url);
    h.setHeader("Cookie", "PHPSESSID=" + neko.Web.getCookies().get("PHPSESSID"));
    ''