As stated by Marcin, you must do URL encoding when passing one URL as a parameter to another URL's GET parameters (not just at LinkedIn URLs, but with all URLs). But there's actually still a bit more here to solve!
You seem to be using an old format of the LinkedIn share API. Since being acquired by Microsoft, much of LinkedIn's documentation (especially the up-to-date stuff) can be found on the Microsoft developer sites. Take a look: Official Microsoft LinkedIn Sharing Documentation. So, your URL should look like...
https://www.linkedin.com/sharing/share-offsite/?url={url}
You are trying to also send a title
and other parameters, but the only supported parameter is url
.
You probably want to share title, etc., information, though, right? In that case, set the og:
tags in the <head>
block of your HTML page, like so...
<meta property='og:title' content='Title of the article"/>
<meta property='og:image' content='//media.example.com/ 1234567.jpg"/>
<meta property='og:description' content='Description that will show in the preview"/>
<meta property='og:url' content='//www.example.com/URL of the article" />
Source: LinkedIn Documentation: Making Your Website Shareable on LinkedIn.
og:
tags really are a good-standards practice, so why not? If you want to know that you set up everything correctly, LinkedIn has you covered there, too:
LinkedIn Post Inspector : Check the URL you are trying to share to make sure everything is properly configured, with the right og:
tags, etc.. Input the URL you are sharing, i.e., example.com/YourSite/ThisPageIsWhatYouWantToBeSharedOnLinkedIn
.
Hope this helps!