|
|
@ -172,7 +172,7 @@ class AnalyzeUrl( |
|
|
|
option.getMethod()?.let { |
|
|
|
option.getMethod()?.let { |
|
|
|
if (it.equals("POST", true)) method = RequestMethod.POST |
|
|
|
if (it.equals("POST", true)) method = RequestMethod.POST |
|
|
|
} |
|
|
|
} |
|
|
|
option.getHeaders()?.forEach { entry -> |
|
|
|
option.getHeaderMap()?.forEach { entry -> |
|
|
|
headerMap[entry.key.toString()] = entry.value.toString() |
|
|
|
headerMap[entry.key.toString()] = entry.value.toString() |
|
|
|
} |
|
|
|
} |
|
|
|
option.getBody()?.let { |
|
|
|
option.getBody()?.let { |
|
|
@ -558,8 +558,8 @@ class AnalyzeUrl( |
|
|
|
private var charset: String? = null, |
|
|
|
private var charset: String? = null, |
|
|
|
private var headers: Any? = null, |
|
|
|
private var headers: Any? = null, |
|
|
|
private var body: Any? = null, |
|
|
|
private var body: Any? = null, |
|
|
|
private var type: String? = null, |
|
|
|
|
|
|
|
private var retry: Int? = null, |
|
|
|
private var retry: Int? = null, |
|
|
|
|
|
|
|
private var type: String? = null, |
|
|
|
private var webView: Any? = null, |
|
|
|
private var webView: Any? = null, |
|
|
|
private var webJs: String? = null, |
|
|
|
private var webJs: String? = null, |
|
|
|
private var js: String? = null, |
|
|
|
private var js: String? = null, |
|
|
@ -580,20 +580,20 @@ class AnalyzeUrl( |
|
|
|
return charset |
|
|
|
return charset |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
fun setType(value: String?) { |
|
|
|
fun setRetry(value: String?) { |
|
|
|
type = if (value.isNullOrBlank()) null else value |
|
|
|
retry = if (value.isNullOrEmpty()) null else value.toIntOrNull() |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
fun getType(): String? { |
|
|
|
fun getRetry(): Int { |
|
|
|
return type |
|
|
|
return retry ?: 0 |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
fun setRetry(value: Int?) { |
|
|
|
fun setType(value: String?) { |
|
|
|
retry = if (value == null || value <= 0) null else value |
|
|
|
type = if (value.isNullOrBlank()) null else value |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
fun getRetry(): Int { |
|
|
|
fun getType(): String? { |
|
|
|
return retry ?: 0 |
|
|
|
return type |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
fun useWebView(): Boolean { |
|
|
|
fun useWebView(): Boolean { |
|
|
@ -615,7 +615,7 @@ class AnalyzeUrl( |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
fun getHeaders(): Map<*, *>? { |
|
|
|
fun getHeaderMap(): Map<*, *>? { |
|
|
|
return when (val value = headers) { |
|
|
|
return when (val value = headers) { |
|
|
|
is Map<*, *> -> value |
|
|
|
is Map<*, *> -> value |
|
|
|
is String -> GSON.fromJsonObject<Map<String, Any>>(value).getOrNull() |
|
|
|
is String -> GSON.fromJsonObject<Map<String, Any>>(value).getOrNull() |
|
|
|