我正在尝试使用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错误,但不知道我哪里出错了。
答案 0 :(得分:0)
(我在Asana工作)
如果要更新任务,则应使用PUT HTTP方法,而不是POST。