您好,我创建了一个节点项目,在其中尝试使用admin-sdk / directory API更新G-suite中的用户照片 我从邮递员传递了base64图像,并将其转换为网络安全的base64字节数据
req.body.photoData.replace(/\//g, '_').replace(/\+/g, '-').replace(/\=/g, '*')
正则表达式上方将根据Google Doc替换照片字节数据的字符串 但是我收到了有关ByteString无效值的错误请求
我关注此文档
https://developers.google.com/admin-sdk/directory/v1/reference/users/photos
建议任何人回答我。
答案 0 :(得分:0)
您不需要替换=
字符,只需替换/
和+
。