Created
May 8, 2025 16:04
-
-
Save tdcolvin/5843efb37de3610da75fc1477f7106c3 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| suspend fun sendRegistrationResponse( | |
| registrationResponseJson: String, | |
| ) = withContext(Dispatchers.IO) { | |
| val url = HttpUrl.Builder() | |
| .scheme("https") | |
| .host("auth.tomcolvin.co.uk") | |
| .addPathSegment("verify-registration") | |
| .build() | |
| val request = Request.Builder() | |
| .url(url) | |
| .post(registrationResponseJson.toRequestBody("application/json".toMediaType())) | |
| .build() | |
| val response = okHttpClient.newCall(request).execute() | |
| if (response.code != 200) { | |
| throw Exception("Registration failed: ${response.body?.string()}") | |
| } | |
| response.body?.string() ?: "{}" | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment