目前我正试图将vb.net网站上的图片发布到pinterest。 我通过记录的方式获得了密钥和访问令牌。 现在,我试图将数据发送到服务器以创建一个引脚,但我得到一个500内部服务器错误。我的请求是否有问题造成了这一点,或者一切都在他们身边。
Public Function SendMessage(url As String, json As String)
Try
Dim client As New RestClient(url)
Dim request As New RestRequest(Method.POST)
request.RequestFormat = DataFormat.Json
request.AddBody(json)
dim response = client.Execute(request)
Return response
Catch ex As exception
Status = ex
Return Nothing
End Try
End Function
使用过的网址https://api.pinterest.com/v1/pins/?access_token= {mytoken}& fields = board%2Cnote%2Cimage%2Clink
和json消息
{
"board": "{board}",
"note": "test pin2",
"link": "{hyperlink}",
"image_url": "{image url}"
}
响应
{
"message": "'str' object has no attribute 'iteritems'",
"type": "http"
}
status: "Internal Server Error"
我希望有人可以指出我做错了。 提前致谢