Documentations › mmo.client › js › core server MMO.core.server · 16 symbols · generated 5 Oct 2026
MMO.core.server.REGEX_LINK = /^\s*<([^>]+)>\s*(.*)$/; Namespace MMO.core.serverMMO.core.server.REGEX_LINK_ATTR = /;?\s*([^=]+)="((?:\\"|[^"])*)"/gm; Namespace MMO.core.serverfunction MMO.core.server.isLink(link) Namespace MMO.core.serverlink stringreturns booleantrue when the string looks like an http Link header value
Serialise a url and its properties as an http Link header value.
function MMO.core.server.createLink(url, properties = {}) Namespace MMO.core.serverThe reverse of `MMO.core.server.extractLink` url stringproperties = {} Object | Mapreturns string@example '<https://x>rel="next"'
Update url query
function MMO.core.server.updateQuery(url, query, asDefault = false) Namespace MMO.core.serverurl Location | stringquery objectasDefault = false boolif true, will only set the query if it is not already present returns string
Serialise an object as a url query string, nesting with php-style brackets.
function MMO.core.server.encodeQuery(query, keyPrefix = '') Namespace MMO.core.serverquery Object | FormDatakeyPrefix = '' string[internal] the parent key, while recursing returns stringwithout the leading '?'
encodeQuery({a: {b: 1}}) => 'a%5Bb%5D=1'
Tells if url is relative
function MMO.core.server.isUrlRelative(url) Namespace MMO.core.serverMake url relative to window location
function MMO.core.server.makeUrlRelative(url, root) Namespace MMO.core.serverurl stringroot string | nullif defined, use this root instead of window location returns string
Test whether a string looks like a public web address: an optional scheme, a host and a tld. A path, a query or a port makes it FAIL, and so does localhost.
function MMO.core.server.isUrl(url) Namespace MMO.core.serverfunction MMO.core.server.encodeValue(name, value, contentType = '') Namespace MMO.core.servername value contentType = ''
Encode arguments list
function MMO.core.server.encode(args, contentType = null) Namespace MMO.core.serverargs array | Object | FormDatacontentType = null returns Object[contentType, value]
Create a Request from an url, data and options
function MMO.core.server.createRequest(url, data = null, opts = {}, method = null) Namespace MMO.core.serverurl stringIf you have placeholders, use prepare with data to inject them data = null ?ObjectIf null will create a Get request opts = {} ObjectThe options to pass to the Request method = null ?stringif null use GET when no data is passed and POST else returns Request