internalRequest()

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

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

method
string, optional

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

get

urls
any, optional

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

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

Cookie scope passed to the request

Alias: cookie

headers
struct, optional

Request header entries passed to the request

Alias: header

body
any, optional

body to send with the request

charset
string, optional

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

addToken
boolean, optional

if yes add urlToken as cookie

false

throwonerror
boolean, optional

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

true

Examples

There are currently no examples for this function 17,534ms WARN No examples for function internalrequest

See also