按照教程, 使用flutter Dio伪造请求头, 请求失败, 提示 Refused to set unsafe header "host"
drooop opened this issue · comments
Kevin_Yang commented
网上查了资料,发现有人说现在请求头不能写某几个key?
然后看了Dio库里的Headers类,发现里面有默认支持的几个key
httpHeaders = {
Headers.acceptHeader: "application/json, text/plain, /",
Headers.contentEncodingHeader: "gzip, deflate, br, drop",
Headers.contentLengthHeader: '',
Headers.contentTypeHeader: 'application/json'
}
是不是除了这几个,其他的都不支持呢(比如'origin')
跪求解惑,拜托大家了