File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed
common/src/main/kotlin/com/lambda/http Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -22,6 +22,7 @@ import com.lambda.util.FolderRegister.cache
2222import com.lambda.util.FolderRegister.createIfNotExists
2323import java.io.File
2424import java.net.HttpURLConnection
25+ import java.net.URI
2526import java.net.URL
2627import kotlin.time.Duration
2728import kotlin.time.Duration.Companion.days
@@ -63,10 +64,10 @@ data class Request(
6364
6465 file.writeText(" " ) // Clear the file before writing to it.
6566
66- val url = URL (
67+ val url = URI (
6768 if (parameters.isNotEmpty() && canBeEncoded) " $url ?${parameters.query} "
6869 else url
69- )
70+ ).toURL()
7071
7172 val connection = url.openConnection() as HttpURLConnection
7273 config.invoke(connection)
@@ -90,10 +91,10 @@ data class Request(
9091 * Executes the HTTP request synchronously.
9192 */
9293 inline fun <reified Success : Any > json (): Response <Success > {
93- val url = URL (
94+ val url = URI (
9495 if (parameters.isNotEmpty() && canBeEncoded) " $url ?${parameters.query} "
9596 else url
96- )
97+ ).toURL()
9798
9899 val connection = url.openConnection() as HttpURLConnection
99100 config.invoke(connection)
You can’t perform that action at this time.
0 commit comments