Components All New MacOS Windows Linux iOS
Examples Mac & Win Server Client Guides Statistic FMM Blog Deprecated Old

CURL.AddOptionHTTPHeader

Adds to the http header list.

Component Version macOS Windows Linux Server iOS SDK
CURL 16.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes ✅ Yes
MBS( "CURL.AddOptionHTTPHeader"; curl; Values... )   More

Parameters

Parameter Description Example
curl The CURL session handle. $curl
Values... Header values "Content-Type: text/xml"

Result

Returns OK or error.

Description

Adds to the http header list.
While CURL.SetOptionHTTPHeader sets them all, you can call CURL.AddOptionHTTPHeader as often as needed to add more HTTP headers.

This function takes variable number of parameters. Pass as much parameters as needed separated by the semicolon in FileMaker.
Please repeat Values parameter as often as you need.

Examples

Set a few HTTP headers:

Let([
    curl = MBS("CURL.New");
    r = MBS( "CURL.AddOptionHTTPHeader"; curl; "Authorization: Bearer a92eabb9-76f9-42ee-b280-bcd15cb2e9db" );
    r = MBS( "CURL.AddOptionHTTPHeader"; curl; "Content-Type: application/json" );
    r = MBS( "CURL.AddOptionHTTPHeader"; curl; "Expect:"; "Cache-Control: no-cache" );
    options = MBS("CURL.Options"; curl)
]; options)

Example result:
{ "HTTPHeader": [ "Authorization: Bearer a92eabb9-76f9-42ee-b280-bcd15cb2e9db", "Content-Type: application/json", "Expect:", "Cache-Control: no-cache" ], "Verbose": 1, "NoProgress": 0, "FollowLocation": 1, "MaxRedirs": 3, "NoSignal": 1, "DisallowUserNameInURL": 1, "UploadBufferSize": 32768 }

Set HTTP Header in script:

Set Variable [ $curl ; Value: MBS("CURL.New") ]
Set Variable [ $result ; Value: MBS("CURL.SetOptionURL"; $curl; CURL Test::URL) ]
Set Variable [ $result ; Value: MBS( "CURL.AddOptionHTTPHeader"; $curl; "Content-Type: application/json" ) ]
Set Variable [ $result ; Value: MBS( "CURL.AddOptionHTTPHeader"; $curl; "Expect:"; "Cache-Control: no-cache" ) ]
Set Field [ CURL Test::Result ; MBS("CURL.Perform"; $curl) ]
Set Field [ CURL Test::Text ; MBS("CURL.GetResultAsText"; $curl; CURL Test::TextEncoding) ]
Set Field [ CURL Test::Debug Messages ; MBS("CURL.GetDebugMessages"; $curl) ]
Set Variable [ $result ; Value: MBS("CURL.Release"; $curl) ]

See also

Release notes

Blog Entries

This function checks for a license.

Created 28th April 2026, last changed 28th April 2026


CURL.AddInputText - CURL.AvailableSSLBackends