[Java-okhttp-gson] Do not set content-type if content type is null #2 (#11315)

* Fixing empty Content-Type in HTTP requests

* Updating samples
This commit is contained in:
mvistein
2022-01-16 03:29:47 +01:00
committed by GitHub
parent 0427681bc4
commit c12456de8e
28 changed files with 152 additions and 152 deletions

View File

@@ -133,7 +133,7 @@ public class AnotherFakeApi {
"application/json"
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarHeaderParams != null && localVarContentTypes != null) {
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}

View File

@@ -141,7 +141,7 @@ public class FakeApi {
"application/xml", "application/xml; charset=utf-8", "application/xml; charset=utf-16", "text/xml", "text/xml; charset=utf-8", "text/xml; charset=utf-16"
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarHeaderParams != null && localVarContentTypes != null) {
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
@@ -272,7 +272,7 @@ public class FakeApi {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarHeaderParams != null && localVarContentTypes != null) {
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
@@ -402,7 +402,7 @@ public class FakeApi {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarHeaderParams != null && localVarContentTypes != null) {
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
@@ -532,7 +532,7 @@ public class FakeApi {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarHeaderParams != null && localVarContentTypes != null) {
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
@@ -662,7 +662,7 @@ public class FakeApi {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarHeaderParams != null && localVarContentTypes != null) {
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
@@ -792,7 +792,7 @@ public class FakeApi {
"application/json"
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarHeaderParams != null && localVarContentTypes != null) {
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
@@ -925,7 +925,7 @@ public class FakeApi {
"application/json"
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarHeaderParams != null && localVarContentTypes != null) {
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
@@ -1064,7 +1064,7 @@ public class FakeApi {
"application/json"
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarHeaderParams != null && localVarContentTypes != null) {
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
@@ -1269,7 +1269,7 @@ public class FakeApi {
"application/x-www-form-urlencoded"
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarHeaderParams != null && localVarContentTypes != null) {
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
@@ -1479,7 +1479,7 @@ public class FakeApi {
"application/x-www-form-urlencoded"
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarHeaderParams != null && localVarContentTypes != null) {
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
@@ -1623,7 +1623,7 @@ public class FakeApi {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarHeaderParams != null && localVarContentTypes != null) {
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
@@ -1844,7 +1844,7 @@ public class FakeApi {
"application/json"
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarHeaderParams != null && localVarContentTypes != null) {
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
@@ -1984,7 +1984,7 @@ public class FakeApi {
"application/x-www-form-urlencoded"
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarHeaderParams != null && localVarContentTypes != null) {
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
@@ -2132,7 +2132,7 @@ public class FakeApi {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarHeaderParams != null && localVarContentTypes != null) {
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}

View File

@@ -133,7 +133,7 @@ public class FakeClassnameTags123Api {
"application/json"
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarHeaderParams != null && localVarContentTypes != null) {
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}

View File

@@ -137,7 +137,7 @@ public class PetApi {
"application/json", "application/xml"
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarHeaderParams != null && localVarContentTypes != null) {
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
@@ -275,7 +275,7 @@ public class PetApi {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarHeaderParams != null && localVarContentTypes != null) {
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
@@ -414,7 +414,7 @@ public class PetApi {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarHeaderParams != null && localVarContentTypes != null) {
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
@@ -556,7 +556,7 @@ public class PetApi {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarHeaderParams != null && localVarContentTypes != null) {
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
@@ -704,7 +704,7 @@ public class PetApi {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarHeaderParams != null && localVarContentTypes != null) {
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
@@ -848,7 +848,7 @@ public class PetApi {
"application/json", "application/xml"
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarHeaderParams != null && localVarContentTypes != null) {
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
@@ -999,7 +999,7 @@ public class PetApi {
"application/x-www-form-urlencoded"
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarHeaderParams != null && localVarContentTypes != null) {
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
@@ -1147,7 +1147,7 @@ public class PetApi {
"multipart/form-data"
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarHeaderParams != null && localVarContentTypes != null) {
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
@@ -1299,7 +1299,7 @@ public class PetApi {
"multipart/form-data"
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarHeaderParams != null && localVarContentTypes != null) {
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}

View File

@@ -135,7 +135,7 @@ public class StoreApi {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarHeaderParams != null && localVarContentTypes != null) {
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
@@ -268,7 +268,7 @@ public class StoreApi {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarHeaderParams != null && localVarContentTypes != null) {
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
@@ -398,7 +398,7 @@ public class StoreApi {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarHeaderParams != null && localVarContentTypes != null) {
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
@@ -540,7 +540,7 @@ public class StoreApi {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarHeaderParams != null && localVarContentTypes != null) {
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}

View File

@@ -134,7 +134,7 @@ public class UserApi {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarHeaderParams != null && localVarContentTypes != null) {
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
@@ -265,7 +265,7 @@ public class UserApi {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarHeaderParams != null && localVarContentTypes != null) {
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
@@ -396,7 +396,7 @@ public class UserApi {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarHeaderParams != null && localVarContentTypes != null) {
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
@@ -529,7 +529,7 @@ public class UserApi {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarHeaderParams != null && localVarContentTypes != null) {
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
@@ -666,7 +666,7 @@ public class UserApi {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarHeaderParams != null && localVarContentTypes != null) {
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
@@ -811,7 +811,7 @@ public class UserApi {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarHeaderParams != null && localVarContentTypes != null) {
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
@@ -956,7 +956,7 @@ public class UserApi {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarHeaderParams != null && localVarContentTypes != null) {
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
@@ -1082,7 +1082,7 @@ public class UserApi {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarHeaderParams != null && localVarContentTypes != null) {
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}