Hi there,
I get it simply go not add a movie to my Movie List
my code:
Dim apiKey As String = "475a861fb396xxxxxxxxxxxxxxxx"
Dim sessionID As String = "b47xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
Dim jsonEncoding As String = "{" & vbLf & " ""media_id"": 127585," & vbLf & "}"
Try
Dim client As New Net.WebClient
client.Headers.Add("Content-Type", "application/json")
client.Headers.Add("Accept", "application/json")
client.Headers.Add("api_key", apiKey)
client.Headers.Add("session_id", sessionID)
Dim url As String = "https://api.themoviedb.org/3/list/53d1fbeb0e0a265dea00e3d7/add_item?api_key=" & apiKey & "&session_id=" & sessionID
Dim responsebytes = client.UploadData(url, "POST", System.Text.Encoding.UTF8.GetBytes(jsonEncoding))
Catch webex As WebException
MsgBox(webex.Message)
Catch ex As Exception
MsgBox(ex.Message)
End Try
Can't find a movie or TV show? Login to create it.
Want to rate or add this item to a list?
Not a member?
Reply by Travis Bell
on July 29, 2014 at 11:59 AM
Hi Askerion,
What's the specific error (and response) you're receiving from that request?
Reply by Askerion
on July 30, 2014 at 2:41 AM
Hi,
I've found the error. Dim jsonEncoding As String = "{" & vbLf & "" "media_id" "127585," & vbLf & "}"
In the Media ID, I had a comma and should not be
Dim jsonEncoding As String = "{" & vbLf & "" "media_id" "127585" & vbLf & "}" that's right
regards