RestRequest.AddHeader

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

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');

Copyright © 2010 - 2023 Emakin. All rights reserved.