I am writing some rest calls to the LinkedIn API using web request and have hit an encoding issue.The LinkedIn API takes requires an encoded URI as one of the parameters on the lookup i am trying to run.
We are calling the api through .Net’s WebRequest.Create; and when we pass in the URI it decodes it and as a result we can’t get the data from the call. Im trying to open a URI like this
http://api.linkedin.com/v1/people/url=http%3A%2F%2Fwww.linkedin.com%2Fin%2FProfileName
Is there a mechanism in the webrequest class to stop it decoding the passed in URI; or a work around for this?
I’m not certain that this will work, but it shows some promise.
The output from
Console.WriteLinethere has the same format as the string you want. If you pass that Uri toWebRequest.Create, it may very well do what you want.