Skip to content

Add custom header #2

@juancarielo

Description

@juancarielo

Add custom header and relateds, example code:

// Array $http_header data default

$headerDataDefault = array('Accept: application/json', 'Content-Type: application/json');
// Check headerData
if (!empty($headerData)) {

    $headerDataDefault = array_merge($headerDataDefault, $headerData);

}

curl_setopt($curl, CURLOPT_HTTPHEADER, $headerDataDefault);

Send custom header:

// $headerData = array('Authorization: HASH_AUTHORIZATION')
RestCurl::exec("GET", $url, $headerData, $obj);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions