This class is used for accessing the local Web server and the current client request and information.

Static variables

staticread onlyisModNeko:Bool

Static methods

@:has_untypedstaticinlineflush ():Void

Flush the data sent to the client. By default on Apache, outgoing data is buffered so this can be useful for displaying some long operation progress.

@:has_untypedstaticgetAuthorization ():{user:String, pass:String}

Returns an object with the authorization sent by the client (Basic scheme only).

staticgetClientHeader (k:String):String

Retrieve a client header value sent with the request.

@:has_untypedstaticgetClientHeaders ():List<{value:String, header:String}>

Retrieve all the client headers.

@:has_untypedstaticinlinegetClientIP ():String

Surprisingly returns the client IP address.

@:has_untypedstaticgetCookies ():Map<String, String>

Returns an hashtable of all Cookies sent by the client. Modifying the hashtable will not modify the cookie, use php.Web.setCookie() instead.

@:has_untypedstaticinlinegetCwd ():String

Get the current script directory in the local filesystem.

@:has_untypedstaticinlinegetHostName ():String

Returns the local server host name.

@:has_untypedstaticgetMethod ():String

Get the HTTP method used by the client.

staticgetMultipart (maxSize:Int):Map<String, String>

Get the multipart parameters as an hashtable. The data cannot exceed the maximum size specified.

@:has_untypedstaticgetParamValues (param:String):Array<String>

Returns an Array of Strings built using GET / POST values. If you have in your URL the parameters a[]=foo;a[]=hello;a[5]=bar;a[3]=baz then php.Web.getParamValues("a") will return ["foo","hello",null,"baz",null,"bar"].

@:has_untypedstaticgetParams ():Map<String, String>

Returns the GET and POST parameters.

@:has_untypedstaticgetParamsString ():String

Returns all the GET parameters String

@:has_untypedstaticgetPostData ():Null<String>

Returns all the POST data. POST Data is always parsed as being application/x-www-form-urlencoded and is stored into the getParams hashtable. POST Data is maximimized to 256K unless the content type is multipart/form-data. In that case, you will have to use php.Web.getMultipart() or php.Web.parseMultipart() methods.

@:has_untypedstaticgetURI ():String

Returns the original request URL (before any server internal redirections).

@:has_untypedstaticparseMultipart (onPart:String ‑> String ‑> Void, onData:Bytes ‑> Int ‑> Int ‑> Void):Void

Parse the multipart data. Call onPart when a new part is found with the part name and the filename if present and onData when some part data is read. You can this way directly save the data on hard drive in the case of a file upload.

@:has_untypedstaticredirect (url:String):Void

Tell the client to redirect to the given url ("Location" header).

@:has_untypedstaticsetCookie (key:String, value:String, ?expire:Date, ?domain:String, ?path:String, ?secure:Bool, ?httpOnly:Bool):Void

Set a Cookie value in the HTTP headers. Same remark as php.Web.setHeader().

@:has_untypedstaticinlinesetHeader (h:String, v:String):Void

Set an output header value. If some data have been printed, the headers have already been sent so this will raise an exception.

@:has_untypedstaticsetReturnCode (r:Int):Void

Set the HTTP return code. Same remark as php.Web.setHeader(). See status code explanation here: