Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Overview

Imports a HTTP header on request.

RestRequest myRestRequest.AddHeader(name: string, value: string)

Arguments

string name
Name of HTTP header
string value
Value of HTTP header

Remarks

Name and Value arguments are required. Otherwise error is thrown.

Example

Code Block
languagets
var client = $Rest.Create('https://login.microsoftonline.com/tenant/oauth2/v2.0/token');
var request = client.Request();

request.AddHeader('Content-Type', 'application/x-www-form-urlencoded');
request.AddHeader('Host', 'login.microsoftonline.com');