[Freeipa-devel] Communicating with FreeIPA via curl
Simo Sorce
ssorce at redhat.com
Thu Jul 22 12:16:16 UTC 2010
On Wed, 21 Jul 2010 16:13:12 -0400
Adam Young <ayoung at redhat.com> wrote:
> The web UI uses JSON RPC to talk to the server. As I look at
> implement more and more functionality, I find I want to see the JSON
> messages much the same way that the ipa command line can show the
> XML-RPC messages. A little trial and error and I got it working:
>
>
> curl -v \
> -H "Content-Type:application/json" \
> -H "Accept:applicaton/json"\
> --negotiate -u : \
> --cacert /etc/ipa/ca.crt \
> -d
> "{\"method\":\"user_find\",\"params\":[[\"\"],{}],\"id\":0}" \ -X
> POST https://`hostname`/ipa/json
You can avoid escaping every single quote with single quotes:
'{"method":"user_find","params":[[""],{}],"id":0}'
Also the ca.crt is available via HTTP iIrc, you just have to download
it once.
> Here's the explanation if you want it.
>
> http://adam.younglogic.com/?p=897
Nice post.
Simo.
--
Simo Sorce * Red Hat, Inc * New York
More information about the Freeipa-devel
mailing list