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.
// object of DecodeUrlRequest
let request = DecodeUrlRequest.builder()
.link("https://likeminds.community/") // url of the link to be decoded
.build()
LMFeedClient.shared.decodeUrl(request) { response in
// response (LMResponse<DecodeUrlResponse>)
if (response.success) {
// your function to process the response data
processResponse(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 | OGTags | OG tags to show link preview |