Skip to main content

Decode URL

Parses and decodes a URL string, providing the original URL components such as protocol, host, path, and query parameters for further processing or display.

Steps to Decode URL

  1. Create a DecodeUrlRequest object using DecodeUrlRequest.Builder class by passing all the required parameters.
  2. Call decodeUrl() function using the instance of LMFeedClient.
  3. Process the response (LMResponse<DecodeUrlResponse>) as per your requirement.
CoroutineScope(Dispatchers.IO).launch {
// object of DecodeUrlRequest
val decodeUrlRequest = DecodeUrlRequest.Builder()
.url("https://likeminds.community/") // url of the link to be decoded
.build()
// get response (LMResponse<DecodeUrlResponse>)
val response = LMFeedClient.getInstance().decodeUrl(decodeUrlRequest)
if (response.success) {
// your function to process the response data
processDecodeUrlResponse(response.data)
} else {
// your function to process error message
processError(response.errorMessage)
}
}

Models

DecodeUrlRequest

VARIABLETYPEDESCRIPTIONOPTIONAL
urlStringURL of the link to be decoded.

DecodeUrlResponse

VARIABLETYPEDESCRIPTIONOPTIONAL
ogTagsLinkOGTagsOG tags to show link preview