@ -82,6 +82,12 @@ fun ResponseBody.text(encode: String? = null): String {
return String(responseBytes, Charset.forName(charsetName))
}
fun Request.Builder.addHeaders(headers: Map<String, String>) {
headers.forEach {
addHeader(it.key, it.value)
fun Request.Builder.get(url: String, queryMap: Map<String, String>, encoded: Boolean = false) {
val httpBuilder = url.toHttpUrl().newBuilder()
queryMap.forEach {
@ -308,9 +308,7 @@ class AnalyzeUrl(
return getProxyClient(proxy).newCallStrResponse(retry) {
removeHeader(UA_NAME)
headerMap.forEach {
addHeaders(headerMap)
when (method) {
RequestMethod.POST -> {
url(url)
@ -330,9 +328,7 @@ class AnalyzeUrl(
@Suppress("BlockingMethodInNonBlockingContext")
return getProxyClient(proxy).newCall(retry) {