TURL_SetCustomHeader (function reference)

By December 1, 2020December 18th, 2020Online Help, Troi URL plug-in
Troi URL Plug-in > Functions reference > TURL_SetCustomHeader
Troi URL Plug-in for FileMaker Pro


Sets a custom header to be used.

SyntaxFunction badge

TURL_SetCustomHeader( switches ; customHeaderText )


switches not used, reserved for future use. Leave blank or put "-unused"
customHeaderText the customHeaderText

Returned Result

Data type returned

Error code


If successful this function returns 0. If unsuccessful it returns an error code starting with $$ followed by the error code.

At the moment this function does not return errors.

Originated in

Troi URL Plug-in 1.2


FileMaker Pro 15 to 19


Some web browsers require a special header text before they return the wanted data. This function allows you to set this text.

The custom header text is remembered until you specify a different text. The text is also removed when you quit FileMaker Pro. The maximum length of the custom header text is 1Gb.

If you don’t specify a custom header text the plug-in will use a default header. If you specify an empty string the default header will be used.

Each line of the custom header needs to be separated with a return. If you use a calculation to construct the custom header, add the return character ¶ between each line.


TURL_SetCustomHeader ("-unused " ; 
"Accept: */*" & "¶" &
"Content-Type: text/html" & "¶" &
"Cookie: 1234-ckie-5678" )

This will send the custom header with each subsequent request. If you want to reset to the default headers use:

Set Field [ result ; TURL_SetCustomHeader ( "-unused" ; "" ) ]

This will clear the custom header text. No custom headers will be sent with a request.

Example 2

Some web servers expect web forms to be sent with specific custom headers (usually x-www-form-urlencoded). In this case you should set the headers before you send the form to the server. This can be done like this:

Set Variable [ $result ; TURL_SetCustomHeader ( "-unused"  ; 
		"Content-Type:application/x-www-form-urlencoded" ) ]
Set Variable [ $resultData ; TURL_Post ( "-unused" ; $URL ; $FormData ) ]

Here $URL is a variable with the URL of the POST and $FormData is a variable that contains the form data to be sent.

Related functionFunction badge


Related topics

Troi URL Plug-in online help (overview)

Online Help Page for Troi URL Plug-in for 15 to 19 –> TURL_SetCustomHeader (urlp4409) 2020-1218 16:18:01