Http
You are viewing an old version of this entry, click here to see latest version.
class haxe.HttpAvailable in flash, flash9, neko, js, php, cpp
var async : BoolAvailable in js
var cnxTimeout : FloatAvailable in neko, php, cpp
var noShutdown : BoolAvailable in neko, php, cpp
var responseHeaders : Hash<String>Available in neko, php, cpp
var url : String
function new( url : String ) : Void
function customRequest( post : Bool, api : Output, ?sock : AbstractSocket, ?method : String ) : VoidAvailable in neko, php, cpp
function fileTransfert( argname : String, filename : String, file : Input, size : Int ) : VoidAvailable in neko, php, cpp
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 ) : Void
function setParameter( param : String, value : String ) : VoidSets a parameter to be sent in the request. Multiple parameters can be set by making multiple
setParameter calls.
function setPostData( data : String ) : VoidAvailable in neko, js, php, cpp
static var PROXY : { port : Int, host : String, auth : { user : String, pass : String } }Available in neko, php, cpp
static function requestUrl( url : String ) : StringAvailable in neko, js, php, cppMake a request and return the server's response.
version #11320, modified 2011-09-25 16:03:20 by api
1 comment
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"));
''