setHeader method
To set headers for Built.io Contentstack rest calls.
Scope is limited to this object and followed classes.
key
header name.
value
header value against given header name.
Example:
final stack = contentstack.Stack('apiKey','deliveryToken','environment');
final query = stack.contentType('content_type_uid').entry().query();
query.setHeader('key', 'value');
Implementation
void setHeader(String key, String value) {
if (key.isNotEmpty && value.isNotEmpty) {
_client.stackHeaders[key] = value;
}
}