Last active
December 17, 2019 18:26
-
-
Save magostinhojr/9c73227c3d82a2941d81ec602a8d8080 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
override fun shouldInterceptRequest( | |
view: WebView?, | |
request: WebResourceRequest? | |
): WebResourceResponse? { | |
return if (request!!.url.path.endsWith("users/login")) { | |
val url = java.net.URL(request.url.toString()) | |
val connection = url.openConnection() | |
connection.connect() | |
val inputStream = connection.getInputStream() | |
val response = JsonReader(InputStreamReader(inputStream)) | |
return null | |
} else { | |
super.shouldInterceptRequest(view, request) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment