HttpResponseConfig class
The request configuration of the request associated with this response.
class HttpResponseConfig {
/**
* The request's URL
*/
String url;
/**
* The request params as a Map
*/
Map params;
/**
* The header map without mangled keys
*/
Map headers;
var data;
var _headersObj;
/**
* Header accessor. Given a string, it will return the matching header,
* case-insentivitively. Without a string, returns a header object will
* upper-case keys.
*/
header([String name]) {
if (_headersObj == null) {
_headersObj = {};
headers.forEach((k,v) {
_headersObj[k.toLowerCase()] = v;
});
}
if (name != null) {
name = name.toLowerCase();
if (!_headersObj.containsKey(name)) return null;
return _headersObj[name];
}
return _headersObj;
}
/**
* Constructor
*/
HttpResponseConfig({this.url, this.params, this.headers, this.data});
}
Constructors
new HttpResponseConfig({String url, Map params, Map headers, data}) #
Constructor
HttpResponseConfig({this.url, this.params, this.headers, this.data});
Properties
var data #
var data
Map headers #
The header map without mangled keys
Map headers
Map params #
The request params as a Map
Map params
String url #
The request's URL
String url
Methods
dynamic header([String name]) #
Header accessor. Given a string, it will return the matching header, case-insentivitively. Without a string, returns a header object will upper-case keys.
header([String name]) {
if (_headersObj == null) {
_headersObj = {};
headers.forEach((k,v) {
_headersObj[k.toLowerCase()] = v;
});
}
if (name != null) {
name = name.toLowerCase();
if (!_headersObj.containsKey(name)) return null;
return _headersObj[name];
}
return _headersObj;
}