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
Un film, une émission télévisée ou un artiste est introuvable ? Connectez-vous afin de créer une nouvelle fiche.
Vous souhaitez évaluer ou ajouter cet élément à une liste ?
Pas encore membre ?
Réponse de Travis Bell
le 29 juillet 2014 à 11h59
Hi Askerion,
What's the specific error (and response) you're receiving from that request?
Réponse de Askerion
le 30 juillet 2014 à 02h41
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