|
|
@ -435,8 +435,13 @@ class AnalyzeUrl( |
|
|
|
when (method) { |
|
|
|
when (method) { |
|
|
|
RequestMethod.POST -> { |
|
|
|
RequestMethod.POST -> { |
|
|
|
url(urlNoQuery) |
|
|
|
url(urlNoQuery) |
|
|
|
|
|
|
|
val contentType = headerMap["Content-Type"] |
|
|
|
|
|
|
|
val body = body |
|
|
|
if (fieldMap.isNotEmpty() || body.isNullOrBlank()) { |
|
|
|
if (fieldMap.isNotEmpty() || body.isNullOrBlank()) { |
|
|
|
postForm(fieldMap, true) |
|
|
|
postForm(fieldMap, true) |
|
|
|
|
|
|
|
} else if (!contentType.isNullOrBlank()) { |
|
|
|
|
|
|
|
val requestBody = body.toRequestBody(contentType.toMediaType()) |
|
|
|
|
|
|
|
post(requestBody) |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
postJson(body) |
|
|
|
postJson(body) |
|
|
|
} |
|
|
|
} |
|
|
@ -466,8 +471,13 @@ class AnalyzeUrl( |
|
|
|
when (method) { |
|
|
|
when (method) { |
|
|
|
RequestMethod.POST -> { |
|
|
|
RequestMethod.POST -> { |
|
|
|
url(urlNoQuery) |
|
|
|
url(urlNoQuery) |
|
|
|
|
|
|
|
val contentType = headerMap["Content-Type"] |
|
|
|
|
|
|
|
val body = body |
|
|
|
if (fieldMap.isNotEmpty() || body.isNullOrBlank()) { |
|
|
|
if (fieldMap.isNotEmpty() || body.isNullOrBlank()) { |
|
|
|
postForm(fieldMap, true) |
|
|
|
postForm(fieldMap, true) |
|
|
|
|
|
|
|
} else if (!contentType.isNullOrBlank()) { |
|
|
|
|
|
|
|
val requestBody = body.toRequestBody(contentType.toMediaType()) |
|
|
|
|
|
|
|
post(requestBody) |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
postJson(body) |
|
|
|
postJson(body) |
|
|
|
} |
|
|
|
} |
|
|
|