我正在尝试使用 VB.NET 将数据发布回 Asana Api,
我能够毫无问题地检索数据,但正在努力重新获取数据。下面是我尝试更新任务中的注释的示例。
Dim add As String = path + "tasks/" + t_id.Text
request = WebRequest.Create(add)
' Set the authentication
setauth()
' Set type to POST
request.Method = "POST"
request.KeepAlive = True
request.ContentType = "application/x-www-form-urlencoded"
data = "-d notes=" + t_notes.Text
byteData = UTF8Encoding.UTF8.GetBytes(data)
request.ContentLength = byteData.Length
'Write(data)
Try
ps = request.GetRequestStream()
ps.Write(byteData, 0, byteData.Length)
Finally
If Not ps Is Nothing Then ps.Close()
End Try
response = request.GetResponse()
我不断收到 404 错误,但不确定我哪里出错了。