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
- Use the
decodeUrl()
function provided by thelmFeedClient
object created earlier. - Create an instance of
DecodeUrlRequest
, as shown in the snippet and pass it to the above method. - Use the response as per your requirement
try {
const decodeUrlRequest = DecodeUrlRequest.builder()
.setLink("https://likeminds.community/") // url of the link to be decoded
.build();
const response = await lmFeedClient.decodeUrl(decodeUrlRequest);
// Use the response as per your requirement.
} catch (error) {
// Use the error as per your requirement.
}
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 |