我正在尝试使用Google任务,通过“尝试这个API”web特性或创建一个任务。
我不能把有效载荷交给工人。
示例:
请求:
{
"task": {
"httpRequest": {
"httpMethod": "POST",
"body": "SGVsbG8=",
"url": "https://some-random-url"
}
}
}响应:
{
"name": "projects/<my-project>/locations/europe-west1/queues/default/tasks/73572672049866200001",
"scheduleTime": "2019-07-03T14:49:34.450453Z",
"createTime": "2019-07-03T14:49:34Z",
"view": "BASIC",
"httpRequest": {
"url": "https://some-random-url/",
"httpMethod": "POST",
"headers": {
"User-Agent": "Google-Cloud-Tasks"
}
},
"dispatchDeadline": "600s"
}示例Ruby代码:
task = {
http_request: {
url: <project/location/queue/url>,
http_method: 'POST',
body: "Something"
}
}
response = @client.create_task(@parent, task)来自Google的截图:
是否有一些特殊的格式来设置一个有效载荷通过邮寄?
谢谢!
发布于 2019-07-08 17:01:13
谢谢您的这篇文章,这是现有的云任务UI中的一个bug,我们正在修复这个bug。 同时,可以通过运行以下命令来确定任务的正确HTTP方法: gcloud beta任务描述 https://cloud.google.com/sdk/gcloud/reference/beta/tasks/describe 上面的命令将显示任务的正确HTTP方法。
答:类型
您还可以使用get任务方法获取更多信息。
https://stackoverflow.com/questions/56873413
复制相似问题