setHeader method

void setHeader(
  1. String key,
  2. String value
)

Adds headers for the request

Example:

final stack = contentstack.Stack(apiKey, deliveryToken, environment);
stack = stack..setHeader('headerKey', 'headervalue');

Implementation

void setHeader(String key, String value) {
  if (key.isNotEmpty && value.isNotEmpty) {
    headers[key] = value;
  }
}