setRequestHeader method

  1. @DomName('XMLHttpRequest.setRequestHeader')
  2. @DocsEditable()
void setRequestHeader(String name, String value)

Sets the value of an HTTP request header.

This method should be called after the request is opened, but before the request is sent.

Multiple calls with the same header will combine all their values into a single header.

Other resources

Source

@DomName('XMLHttpRequest.setRequestHeader')
@DocsEditable()
void setRequestHeader(String name, String value) =>
    _blink.BlinkXMLHttpRequest.instance
        .setRequestHeader_Callback_2_(this, name, value);

© 2012 the Dart project authors
Licensed under the Creative Commons Attribution-ShareAlike License v4.0.
https://api.dartlang.org/stable/1.24.3/dart-html/HttpRequest/setRequestHeader.html