我正在尝试更新任务的dueDate:
Task updatedTask = service.tasks.get(gTask.getTaskListGuid(), gTask.getGuid()).execute();
updatedTask.setTitle(gTask.getTitle());
updatedTask.setNotes(gTask.getDescription());
updatedTask.setDue(gTask.getDueDate());
service.tasks.update(gTask.getTaskListGuid(), gTask.getGuid(), updatedTask).execute();
但是api让我回答:
10:49:40,323 ERROR GTasksServiceProcessor.[main]processUpdatedTasks:81 - Can't update task: com.google.api.client.http.HttpResponseException: 400 Bad Request
com.google.api.client.http.HttpResponseException: 400 Bad Request
at com.google.api.client.http.HttpRequest.execute(HttpRequest.java:708)
at com.google.api.services.tasks.Tasks$RemoteRequest.execute(Tasks.java:1574)
at com.google.api.services.tasks.Tasks$TasksOperations$Update.executeUnparsed(Tasks.java:870)
at com.google.api.services.tasks.Tasks$TasksOperations$Update.execute(Tasks.java:855)
at ua.com.stormlabs.gap.gtasks.GTasksManager.updateTask(GTasksManager.java:120)
at ua.com.stormlabs.gap.gtasks.GTasksServiceProcessor.processUpdatedTasks(GTasksServiceProcessor.java:78)
at ua.com.stormlabs.gap.gtasks.GTasksServiceProcessor.start(GTasksServiceProcessor.java:51)
at ua.com.stormlabs.gap.gtasks.GTasksGapApp.main(GTasksGapApp.java:21)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:120)
哪里有问题? 尝试使用dueDate创建新任务时,我遇到同样的异常。
我也找到了帖子: http://groups.google.com/group/google-tasks-api/browse_thread/thread/1753df5bbc8e3cb8/ab66b5e675f06e6a?lnk=gst&q=problem+changing#ab66b5e675f06e6a 但它对我没有帮助。
答案 0 :(得分:0)