我正在使用 API 调用content.deidentify
对文本内容进行去标识化。它按预期工作,但换行符被剥离。
API 调用
curl -s \
-H "Authorization: Bearer $(gcloud auth print-access-token)" \
-H "Content-Type: application/json" \
https://dlp.googleapis.com/v2/projects/$PROJECT_ID/content:deidentify \
-d @text-request.json \
> text-response.json
输入
Eleanor Rigby
Pharmacist
Liverpool Hospital
eleanor.rigby@example.com
输出
{
"item": {
"value": "Eleanor Rigby Pharmacist Liverpool Hospital [email-address]"
},
"overview": {
...
}
}
我可以在请求中添加任何选项以保留换行符吗?
我setPrettyPrint
在 Java 客户端文档中找到了。直接调用 API 时可以使用该选项吗?