fix: remove redundant body payload from codegen

This commit is contained in:
Tanish2002
2024-02-23 13:50:29 +05:30
parent d346be2a54
commit 693b4bda70
3 changed files with 7 additions and 3 deletions

View File

@ -130,7 +130,9 @@ body = b'\r\n'.join(dataList)
var method = requestModel.method;
var requestBody = requestModel.requestBody;
if (kMethodsWithBody.contains(method) && requestBody != null) {
if (kMethodsWithBody.contains(method) &&
requestBody != null &&
!requestModel.isFormDataRequest) {
var contentLength = utf8.encode(requestBody).length;
if (contentLength > 0) {
hasBody = true;