mirror of
https://github.com/foss42/apidash.git
synced 2025-05-22 16:57:07 +08:00
refact: codegen to override content-type header
This commit is contained in:
@ -102,7 +102,9 @@ print(data.decode("utf-8"))
|
||||
var headers = requestModel.headersMap;
|
||||
if (headers.isNotEmpty || hasBody) {
|
||||
hasHeaders = true;
|
||||
if (hasBody) {
|
||||
bool hasContentTypeHeader = headers.keys.any((k) => k.toLowerCase() == HttpHeaders.contentTypeHeader);
|
||||
|
||||
if (hasBody && !hasContentTypeHeader) {
|
||||
headers[HttpHeaders.contentTypeHeader] =
|
||||
kContentTypeMap[requestModel.requestBodyContentType] ?? "";
|
||||
}
|
||||
|
Reference in New Issue
Block a user