package neko
Deprecated: "neko.Web is deprecated and will be removed from standard library in Haxe 4.2"
Available on neko
This class is used for accessing the local Web server and the current client request and information.
staticread onlyisModNeko:Boolstaticread onlyisTora:BoolstaticcacheModule(f:() ‑> Void):VoidSet the main entry point function used to handle requests. Setting it back to null will disable code caching.
staticflush():VoidFlush 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.
staticgetAuthorization():{user:String, pass:String}Returns an object with the authorization sent by the client (Basic scheme only).
staticgetClientHeader(k:String):StringRetrieve a client header value sent with the request.
staticgetClientHeaders():List<{value:String, header:String}>Retrieve all the client headers.
staticgetClientIP():StringSurprisingly returns the client IP address.
staticgetCookies():Map<String, String>Returns an hashtable of all Cookies sent by the client. Modifying the hashtable will not modify the cookie, use setCookie instead.
staticgetCwd():StringGet the current script directory in the local filesystem.
staticgetHostName():StringReturns the local server host name.
staticgetMethod():StringGet the HTTP method used by the client. This API requires Neko 1.7.1+.
staticgetMultipart(maxSize:Int):Map<String, String>Get the multipart parameters as an hashtable. The data cannot exceed the maximum size specified.
staticgetParamValues(param:String):Array<String>Returns an Array of Strings built using GET / POST values. If the URL contains the parameters [a[]=foo;a[]=hello;a[5]=bar;a[3]=baz] then neko.Web.getParamValues("a") will return ["foo","hello",null,"baz",null,"bar"]
staticgetParams():StringMap<String>Returns the GET and POST parameters.
staticgetParamsString():StringReturns all the GET parameters String.
staticgetPostData():StringReturns 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 getMultipart or parseMultipart methods.
staticgetURI():StringReturns the original request URL (before any server internal redirections)
staticlogMessage(msg:String):VoidWrite a message into the web server log file. This API requires Neko 1.7.1+.
staticparseMultipart(onPart:(String, String) ‑> Void, onData:(Bytes, Int, Int) ‑> Void):VoidParse 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.
staticredirect(url:String):VoidTell the client to redirect to the given url ("Location" header)
staticsetCookie(key:String, value:String, ?expire:Date, ?domain:String, ?path:String, ?secure:Bool, ?httpOnly:Bool):VoidSet a Cookie value in the HTTP headers. Same remark as setHeader.
staticsetHeader(h:String, v:String):VoidSet an output header value. If some data have been printed, the headers have already been sent so this will raise an exception.
staticsetReturnCode(r:Int):VoidSet the HTTP return code. Same remark as setHeader.
© 2005–2020 Haxe Foundation
Licensed under a MIT license.
https://api.haxe.org/neko/Web.html