internalRequest()

edit

Makes a request to the CFML Engine internally. also available in 5.x as _internalRequest()

Great for CI / tests, internalRequest allows you to call another cfml page on the same server without needing to make an http call

Introduced: 6.0.0.161

internalRequest( template=string, method=string, urls=any, forms=any, cookies=struct, headers=struct, body=any, charset=string, addToken=boolean, throwonerror=boolean );

Returns: Struct

Argument Description Default
template
string, required
edit

Template path (script name) for the request (example:/test/index.cfm).

method
string, optional
edit

method of the request (GET,POST,PUT,DELETE ...)

get

urls
any, optional
edit

URL scope passed to the request (query string). This can be a struct or a string following this format [name1=value1&name2=value2].

Alias: url

forms
any, optional
edit

FORM scope passed to the request.This can be a struct or a string following this format [name1=value1&name2=value2].

Alias: form

cookies
struct, optional
edit

Cookie scope passed to the request

Alias: cookie

headers
struct, optional
edit

Request header entries passed to the request

Alias: header

body
any, optional
edit

body to send with the request

charset
string, optional
edit

charset used for the request, if not set the web charset is used.

addToken
boolean, optional
edit

if yes add urlToken as cookie

false

throwonerror
boolean, optional
edit

if true (default) and the called page throws an exception, that exception is also thrown within the caller request. If false it is caught and only reported in the resulting struct.

true

Examples

There are currently no examples for this function 37,343ms WARN No examples for function InternalRequest

See also