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
- Create a DecodeUrlRequest object using
DecodeUrlRequest.Builder
class by passing all the required parameters. - Call
decodeUrl()
function using the instance ofLMFeedClient
. - 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
VARIABLE | TYPE | DESCRIPTION | OPTIONAL |
---|---|---|---|
url | String | URL of the link to be decoded. |
DecodeUrlResponse
VARIABLE | TYPE | DESCRIPTION | OPTIONAL |
---|---|---|---|
ogTags | LinkOGTags | OG tags to show link preview |