mirror of
https://github.com/foss42/apidash.git
synced 2025-05-23 17:26:45 +08:00
fix: redundant dart(http) codegen
This commit is contained in:
@ -53,7 +53,9 @@ class DartHttpCodeGen {
|
||||
declareVar('uri').assign(refer('Uri.parse').call([literalString(url)]));
|
||||
|
||||
Expression? dataExp;
|
||||
if (kMethodsWithBody.contains(method) && (body?.isNotEmpty ?? false)) {
|
||||
if (kMethodsWithBody.contains(method) &&
|
||||
(body?.isNotEmpty ?? false) &&
|
||||
contentType != ContentType.formdata) {
|
||||
final strContent = CodeExpression(Code('r\'\'\'$body\'\'\''));
|
||||
dataExp = declareVar('body', type: refer('String')).assign(strContent);
|
||||
if (!hasContentTypeHeader) {
|
||||
|
Reference in New Issue
Block a user