OPENIDM- HTTP PUT cURL请求

时间:2018-08-28 12:15:26

标签: openidm

我是openIDM的新手,我正在尝试执行以下查询,以期获得预期的正确结果,即POST。

$ curl -k -s https://localhost/openidm/managed/zzzz?_action=create -H 'Content-Type: application/json' -H 'X-OpenIDM-Username: '"openidm-admin"'' -H 'X-OpenIDM-Password: '"openidm-admin"'' -H 'Accept: application/json' -d 
'{ "x": "'"AA1"'", "xx": "'"xx"'", "xxx": "'"xxx"'","xxxx": "'"xxxx"'"}'

结果:

  

{“ _ id”:“ db0489f6-d390-481f-8708-0970b3e42469”,“ _ rev”:“ 0”,“ x”:“ AA1”,“ xx”:“ xx”,“ xxx”:“ xxx “,” xxxx“:” xxxx“}

但是我想将id值创建为客户端分配的ID,而不是openidm生成的ID,为此,我正在使用如下PUT命令

$ curl -k -s PUT https://xxxx/openidm/managed/zzzz/AA1 -H 'Content-Type: application/json' -H 'X-OpenIDM-Username: '"openidm-admin"'' -H 'X-OpenIDM-Password: '"openidm-admin"'' -H 'Accept: application/json' -d '{ "x": "'"AA1"'", "xx": "'"xx"'", "xxx": "'"xxx"'","xxxx": "'"xxxx"'"}'

结果:

  

{“代码”:400,“原因”:“错误请求”,“消息”:“资源实例   / managed / zzzz / AA1无法创建“}

输出我想要的是

{"_id":"AA1","_rev":"0","x":"AA1","xx":"xx","xxx":"xxx","xxxx":"xxxx"}

我不确定自己在做什么错,有什么建议吗?我遵循了openidm文档,下面是该链接。

https://backstage.forgerock.com/docs/idm/5.5/integrators-guide/#about-crest-create

0 个答案:

没有答案