mirror of
https://github.com/foss42/apidash.git
synced 2025-05-24 01:36:46 +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)]));
|
declareVar('uri').assign(refer('Uri.parse').call([literalString(url)]));
|
||||||
|
|
||||||
Expression? dataExp;
|
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\'\'\''));
|
final strContent = CodeExpression(Code('r\'\'\'$body\'\'\''));
|
||||||
dataExp = declareVar('body', type: refer('String')).assign(strContent);
|
dataExp = declareVar('body', type: refer('String')).assign(strContent);
|
||||||
if (!hasContentTypeHeader) {
|
if (!hasContentTypeHeader) {
|
||||||
|
Reference in New Issue
Block a user