LoginSignup
0
0

More than 1 year has passed since last update.

google-cloud/tasks モジュールでbodyが取得できない場合の対策

Posted at

概要

Cloud TasksPostした値が取得できなかった際の対応をまとめる

解決方法

Quickstartに記載されている方法では取得できないので以下の通りにする

body: Buffer.from(JSON.stringify(payload)).toString('base64')

const payload = {
  foo: 'bar',
};

 const task = {
      httpRequest: {
        httpMethod: HttpMethod.POST,
        url: 'URL',
        oidcToken: {
          serviceAccountEmail:
            'serviceAccountEmail',
        },
        body: Buffer.from(JSON.stringify(payload)).toString('base64'),
        headers: {
          'Content-Type': 'application/json',
        },
      },
    }

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0