Link_1 11 Light Poster

Error: The Remote Server Returned An Error 400 Bad Request

I am using asp vb.net and instagram api

also I am using Newtonsoft.Json -Version 10.0.3

I following below link as a tutorial but issue is I am converting code from c# to VB and I am getting an error:
https://code.msdn.microsoft.com/Haroon-Said-e1d8d388

The insta api's documentation says I need to request it like this :

curl \-F 'client_id=CLIENT-ID' \
-F 'client_secret=CLIENT-SECRET' \
-F 'grant_type=authorization_code' \
-F 'redirect_uri=YOUR-REDIRECT-URI' \
-F 'code=CODE' \https://api.instagram.com/oauth/access_token

I am getting an error on line client.uploadvalues(...)

Dim parameters As New NameValueCollection
parameters.Add("client_id", "ssdfsdfsdfsdfsdf")
parameters.Add("client_secret", "sdsdfdsfsdfsdfsdfsdfsdf")
parameters.Add("grant_type", "authorization_code")
parameters.Add("redirect_uri", "http://localhost:8979/UI/InstaHome.aspx")
parameters.Add("code", "5ce168cc4dee45388af9d297324dda3a")

Dim client As WebClient = New WebClient()
Dim result = client.UploadValues("https://api.instagram.com/oauth/access_token", "POST", parameters)
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.